Documentation
¶
Overview ¶
Package cmdmenu owns BotFather's own command menu — the /newbot, /help, ... entries written to robot.bot_commands and rendered by clients as the chat command picker (#335).
The menu is server-owned copy (unlike user bots' commands, which are creator content set via POST /v1/bot/setCommands and are never localized), so its descriptions render through the shared msgtmpl catalog. The stored blob can only carry ONE language, therefore localization happens in two layers:
- startup (botfather.registerBotFatherCommands) writes the blob in the deployment default language — the floor served by paths that genuinely have no request context (admin robot detail, future context-less reads);
- every request-bearing read of the blob overrides it per request via JSON(i18n.OutboundLanguage(ctx)), for the BotFather UID only: channel info extra.bot_commands, /v1/robot/commands, /v1/users/:uid, and the batch user-detail fill (user.Service.GetUserDetails) behind friend sync / friend search / search / conversation enrichment.
This package is deliberately a LEAF (msgtmpl + pkg/i18n only): botfather imports user, so the read-side modules (user, channel, robot) can only share this catalog through a package that imports neither.
Index ¶
Constants ¶
const BotFatherUID = "botfather"
BotFatherUID is the BotFather system bot's UID. The canonical constant lives here (not in the botfather package, which aliases it) so the read-side override call sites can match it without an import cycle.
Variables ¶
This section is empty.