Skip to content

How to add a mini app as a button in the bot menu

The Open button in a bot menu is what separates a mini app from a link somebody has to be sent. Here is where it comes from, what it takes, and why it sometimes points at the wrong place.

Where the token comes from

The token is issued by @BotFather, Telegram’s own service bot. Send /newbot, pick a name and an address, and back comes a line like 123456789:AA... That is the token: the bot’s password, granting the right to act on its behalf.

If the bot already exists, /mybots → pick the bot → API Token shows it. A token can be reissued, but the old one then stops working — including the button it had set.

What the builder does with it

A token pasted in the editor is checked with Telegram — whose it is and whether it is alive — and stored encrypted. On publish the builder calls Telegram’s setChatMenuButton with your token and points the menu button at the app’s address.

So there is nothing to do in BotFather after /newbot: the address neither needs nor should be typed in by hand. By hand is one more chance to mistype an address and not notice.

The button is missing or points elsewhere

The button is set at the moment of publishing. If the app has not been published, there is nothing to point at and the menu stays as it was. The first thing to check is whether publishing went through and the address opens.

If the bot previously had a button pointing somewhere else — typed in by hand or set by another platform — publishing repoints it. The reverse holds too: reissue the token or disconnect the bot and the button keeps pointing wherever it was last set.

A bot has one menu button. Two apps in one bot cannot be separated by it: the second needs its own bot, or the move between them happens inside the app, as screens.

Step by step

  1. 1Create a bot with @BotFather via /newbot, or open an existing one via /mybots.
  2. 2Copy the token in full, including the digits before the colon.
  3. 3Paste it in the editor, in the bot connection section.
  4. 4Publish the app: the menu button points itself at its address.

Other questions

Is handing over the token safe?
The token is stored encrypted and is needed for exactly two things: setting the menu button and sending you form submissions. The bot can be disconnected at any time, and the token is forgotten.
Can the app go into somebody else’s bot?
Only if you have its token, which means only if the bot is yours. A token is access to the whole bot, and asking a stranger for one is not a good idea.
What if no bot is connected?
The app still publishes and still opens at its address, but there will be no menu button and nobody to send form submissions to. Some features — records kept for a visitor, for instance — also need a connected bot.
Open the builderStart from a ready template: Portfolio and services

Neighbouring guides

Where to go next