In short
setChatMenuButton configures the left-side Bot Menu Button (commands / web_app / default). It never creates or removes the right-side Reply Keyboard. Omit chat_id for the global default; with chat_id, override a private chat that has already interacted with the bot.
Overview
The chat input row has two independent controls: the left Menu Button (this article) and the right Reply Keyboard toggle (see the Reply Keyboard guide). Parameter-level truth is always core.mp.net/bots.
Left menu vs right Reply Keyboard
Left — Menu Button: set with
setChatMenuButton/getChatMenuButton. Types:commands,web_app,default.Right — Reply Keyboard: set only via message
reply_markup(ReplyKeyboardMarkup/ Remove). Menu APIs never expand or hide it.Changing one side does not change the other.
Types: commands, web_app, default
type | Effect |
| Shows the bot command list on the left control. |
| Shows a labeled button that opens an HTTPS URL (text + |
| Clears an explicit override for that scope (omit |
commands and web_app are mutually exclusive forms for one scope.
Scope: omit chat_id vs private chat_id
Omit
chat_id: sets the global menu for the bot.With
chat_id: must identify a private chat that has already interacted with this bot; that chat gets an override.Read back with
getChatMenuButton(same scope rules). The result never describes whether the Reply Keyboard toggle is visible.
web_app: any HTTPS ≤ 2048
Official rule (not PRD)
Menu Button web_app accepts text plus any valid HTTPS URL up to 2048 characters. It does not require MiniApp ownership, a MiniApp ID, or registration under the current bot. (Inline / Reply Keyboard web_app ownership rules are separate — do not copy those constraints here.)
text(button title) max length: 64.URL scheme must be HTTPS.
BotFather path (brief)
You can also set the left menu in BotFather under the bot’s Menu Button settings. That UI maps to the same left-side control as setChatMenuButton; prefer the API when you need per-chat overrides or automation.
Minimal request
POST https://call.mp.net/bot/bot<token>/setChatMenuButton
{
"menu_button": {
"type": "web_app",
"text": "Open App",
"web_app": { "url": "https://example.com/app" }
}
}
Related
Reply Keyboard: send, switch, one-time hide, and remove (this collection)
Core message methods: getMe, getUpdates, sendMessage (reply_markup)
