Callback Queries
🔔 Callback Queries
Section titled “🔔 Callback Queries”This page documents all inline button callback handlers in Alita Robot.
Overview
Section titled “Overview”- Total Callbacks: 21
- Modules with Callbacks: 14
Callback Data Format
Section titled “Callback Data Format”Callbacks use a prefix-based routing system:
{prefix}{data}For example: restrict.ban.123456789 routes to the restrict. handler with data ban.123456789.
All Callbacks
Section titled “All Callbacks”| Module | Prefix | Handler |
|---|---|---|
| Bans | restrict. | restrictButtonHandler |
| Bans | unrestrict. | unrestrictButtonHandler |
| Blacklists | rmAllBlacklist | buttonHandler |
| Captcha | captcha_refresh. | captchaRefreshCallback |
| Captcha | captcha_verify. | captchaVerifyCallback |
| Connections | connbtns. | connectionButtons |
| Filters | filters_overwrite. | filterOverWriteHandler |
| Filters | rmAllFilters | filtersButtonHandler |
| Formatting | formatting. | formattingHandler |
| Greetings | join_request. | joinRequestHandler |
| Help | about | about |
| Help | configuration | botConfig |
| Help | helpq | helpButtonHandler |
| Languages | change_language. | langBtnHandler |
| Notes | notes.overwrite. | noteOverWriteHandler |
| Notes | rmAllNotes | notesButtonHandler |
| Pins | unpinallbtn | unpinallCallback |
| Purges | deleteMsg. | deleteButtonHandler |
| Reports | report. | markResolvedButtonHandler |
| Warns | rmAllChatWarns | warnsButtonHandler |
| Warns | rmWarn | rmWarnButton |
Callbacks by Module
Section titled “Callbacks by Module”restrict.
Section titled “restrict.”- Handler:
restrictButtonHandler - Source:
bans.go
unrestrict.
Section titled “unrestrict.”- Handler:
unrestrictButtonHandler - Source:
bans.go
Blacklists
Section titled “Blacklists”rmAllBlacklist
Section titled “rmAllBlacklist”- Handler:
buttonHandler - Source:
blacklists.go
Captcha
Section titled “Captcha”captcha_refresh.
Section titled “captcha_refresh.”- Handler:
captchaRefreshCallback - Source:
captcha.go
captcha_verify.
Section titled “captcha_verify.”- Handler:
captchaVerifyCallback - Source:
captcha.go
Connections
Section titled “Connections”connbtns.
Section titled “connbtns.”- Handler:
connectionButtons - Source:
connections.go
Filters
Section titled “Filters”filters_overwrite.
Section titled “filters_overwrite.”- Handler:
filterOverWriteHandler - Source:
filters.go
rmAllFilters
Section titled “rmAllFilters”- Handler:
filtersButtonHandler - Source:
filters.go
Formatting
Section titled “Formatting”formatting.
Section titled “formatting.”- Handler:
formattingHandler - Source:
formatting.go
Greetings
Section titled “Greetings”join_request.
Section titled “join_request.”- Handler:
joinRequestHandler - Source:
greetings.go
- Handler:
about - Source:
help.go
configuration
Section titled “configuration”- Handler:
botConfig - Source:
help.go
- Handler:
helpButtonHandler - Source:
help.go
Languages
Section titled “Languages”change_language.
Section titled “change_language.”- Handler:
langBtnHandler - Source:
language.go
notes.overwrite.
Section titled “notes.overwrite.”- Handler:
noteOverWriteHandler - Source:
notes.go
rmAllNotes
Section titled “rmAllNotes”- Handler:
notesButtonHandler - Source:
notes.go
unpinallbtn
Section titled “unpinallbtn”- Handler:
unpinallCallback - Source:
pins.go
Purges
Section titled “Purges”deleteMsg.
Section titled “deleteMsg.”- Handler:
deleteButtonHandler - Source:
purges.go
Reports
Section titled “Reports”report.
Section titled “report.”- Handler:
markResolvedButtonHandler - Source:
reports.go
rmAllChatWarns
Section titled “rmAllChatWarns”- Handler:
warnsButtonHandler - Source:
warns.go
rmWarn
Section titled “rmWarn”- Handler:
rmWarnButton - Source:
warns.go
Registering Callbacks
Section titled “Registering Callbacks”dispatcher.AddHandler(handlers.NewCallback( callbackquery.Prefix("myprefix."), myModule.myCallbackHandler,))Handling Callbacks
Section titled “Handling Callbacks”func (m moduleStruct) myCallbackHandler(b *gotgbot.Bot, ctx *ext.Context) error { query := ctx.CallbackQuery
// Parse callback data data := strings.TrimPrefix(query.Data, "myprefix.")
// Process and answer query.Answer(b, &gotgbot.AnswerCallbackQueryOpts{ Text: "Action completed", })
return ext.EndGroups}