The short answer
- 1The menu button shows the command list by default; it can open a mini app instead.
- 2Use @BotFather, or setChatMenuButton with a chat_id to change it for one user.
- 3Keep /start and /help working after the switch.
In this article
What the menu button is
In a private chat with a bot, the menu button sits next to the message field. By default, tapping it shows the list of commands the bot registered, with their descriptions. You can change it to open a mini app instead, so users get into your bot's interface with one tap and never have to remember a command. For how users experience mini apps, see how to use Telegram mini apps.
| MenuButton type | What a tap does | Suits |
|---|---|---|
commands | Shows the command list | Bots that work through a few commands |
web_app | Opens the mini app you set, with a button label you choose | Bots with a real interface: orders, bookings, games |
default | Whatever the default behaviour is | Undoing a change |
Two ways to change it
Without code
In @BotFather, choose your bot, open its settings, find the menu button option, and set the mini app's URL and the button label.
With the Bot API
Call setChatMenuButton. Leave out chat_id and you change the default for every user; include it and only that one user's chat changes.
curl https://api.telegram.org/bot123456:ABC-EXAMPLE/setChatMenuButton \
-H "Content-Type: application/json" \
-d '{"menu_button":{"type":"web_app","text":"Order",
"web_app":{"url":"https://example.com/app"}}}'
getChatMenuButton shows the current setting. The mini app URL must use HTTPS. The token and URL above are examples; see your first Bot API requests.
A different button for each user
Because chat_id targets one user, you can give people different buttons. For example, users who have finished signing up get a "My orders" mini app button, while newcomers keep the command list with a getting-started command.
Keep your commands working
Switching the menu button to a mini app only removes the command list from that button. Users who type / still see your commands, so keep /start and /help working; see registering bot commands.
FAQ
How do I make my Telegram bot's menu button open a mini app?
In @BotFather set the menu button's URL and label, or call setChatMenuButton with type web_app and an HTTPS URL.
Can different users see different menu buttons?
Yes. Call setChatMenuButton with that user's chat_id to change only their chat.
Do my commands still work after changing the menu button?
Yes. Typing / still shows them, so keep /start and /help handled.
Sources
At a glance
- 1Types
commands, web_app or default.
- 2Scope
No chat_id changes everyone; a chat_id changes one user.
- 3Safety
Verify mini app user data on your server.
Updated