Skip to content

Callback Queries

This page documents all inline button callback handlers in Alita Robot.

  • Total Callbacks: 21
  • Modules with Callbacks: 14

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).

Legacy dot-notation (prefix.field1.field2) is accepted by handlers for backward compatibility but is deprecated. All new callbacks use the versioned format.

ModulePrefixHandler
BansrestrictrestrictButtonHandler
BansunrestrictunrestrictButtonHandler
BlacklistsrmAllBlacklistbuttonHandler
Captchacaptcha_refreshcaptchaRefreshCallback
Captchacaptcha_verifycaptchaVerifyCallback
ConnectionsconnbtnsconnectionButtons
Filtersfilters_overwritefilterOverWriteHandler
FiltersrmAllFiltersfiltersButtonHandler
FormattingformattingformattingHandler
Greetingsjoin_requestjoinRequestHandler
Helpaboutabout
HelpconfigurationbotConfig
HelphelpqhelpButtonHandler
Languageschange_languagelangBtnHandler
Notesnotes.overwritenoteOverWriteHandler
NotesrmAllNotesnotesButtonHandler
PinsunpinallbtnunpinallCallback
PurgesdeleteMsgdeleteButtonHandler
ReportsreportmarkResolvedButtonHandler
WarnsrmAllChatWarnswarnsButtonHandler
WarnsrmWarnrmWarnButton
  • Handler: restrictButtonHandler
  • Source: bans.go
  • Handler: unrestrictButtonHandler
  • Source: bans.go
  • Handler: buttonHandler
  • Source: blacklists.go
  • Handler: captchaRefreshCallback
  • Source: captcha.go
  • Handler: captchaVerifyCallback
  • Source: captcha.go
  • Handler: connectionButtons
  • Source: connections.go
  • Handler: filterOverWriteHandler
  • Source: filters.go
  • Handler: filtersButtonHandler
  • Source: filters.go
  • Handler: formattingHandler
  • Source: formatting.go
  • Handler: joinRequestHandler
  • Source: greetings.go
  • Handler: about
  • Source: help.go
  • Handler: botConfig
  • Source: help.go
  • Handler: helpButtonHandler
  • Source: help.go
  • Handler: langBtnHandler
  • Source: language.go
  • Handler: noteOverWriteHandler
  • Source: notes.go
  • Handler: notesButtonHandler
  • Source: notes.go
  • Handler: unpinallCallback
  • Source: pins.go
  • Handler: deleteButtonHandler
  • Source: purges.go
  • Handler: markResolvedButtonHandler
  • Source: reports.go
  • Handler: warnsButtonHandler
  • Source: warns.go
  • Handler: rmWarnButton
  • Source: warns.go
// Encode callback data
data, err := callbackcodec.Encode("restrict", map[string]string{
"a": "ban",
"uid": "123456789",
})
// -> "restrict|v1|a=ban&uid=123456789"
// Empty payload
data, err := callbackcodec.Encode("helpq", map[string]string{})
// -> "helpq|v1|_"
// Decode callback data
decoded, err := callbackcodec.Decode("restrict|v1|a=ban&uid=123456789")
namespace := decoded.Namespace // "restrict"
action, _ := decoded.Field("a") // "ban"
uid, _ := decoded.Field("uid") // "123456789"
dispatcher.AddHandler(handlers.NewCallback(
callbackquery.Prefix("restrict"),
myModule.restrictHandler,
))