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 versioned codec with URL-encoded fields:
<namespace>|v1|<url-encoded-fields>For example: restrict|v1|a=ban&uid=123456789 routes to the restrict namespace handler.
When the payload has no fields, _ is used as placeholder: helpq|v1|_.
Maximum length: 64 bytes (Telegram’s callback_data limit).
Backward Compatibility
Section titled “Backward Compatibility”Legacy dot-notation (prefix.field1.field2) is accepted by handlers for backward compatibility but is deprecated. All new callbacks use the versioned format.
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
Code Example
Section titled “Code Example”Encoding and Decoding Callback Data
Section titled “Encoding and Decoding Callback Data”// Encode callback datadata, err := callbackcodec.Encode("restrict", map[string]string{ "a": "ban", "uid": "123456789",})// -> "restrict|v1|a=ban&uid=123456789"
// Empty payloaddata, err := callbackcodec.Encode("helpq", map[string]string{})// -> "helpq|v1|_"
// Decode callback datadecoded, err := callbackcodec.Decode("restrict|v1|a=ban&uid=123456789")namespace := decoded.Namespace // "restrict"action, _ := decoded.Field("a") // "ban"uid, _ := decoded.Field("uid") // "123456789"Registering a Callback Handler
Section titled “Registering a Callback Handler”dispatcher.AddHandler(handlers.NewCallback( callbackquery.Prefix("restrict"), myModule.restrictHandler,))