Building

How to set up a Telegram bot command menu

By the Botable team

The command menu is the list that appears when someone taps the menu button next to the message box. Set it with /setcommands in @BotFather or the setMyCommands API method. It is the cheapest discoverability improvement a bot can get.

The short version

The Telegram command menu is the list of commands with descriptions that appears beside the message box, and it is the primary way anyone discovers what a bot can do. Without it, a bot's capabilities are invisible: users are left guessing at command names or scrolling back through a /help message they saw once. Setting it takes a minute through @BotFather's /setcommands, which accepts one command per line as "name - description" without the leading slash, or programmatically through setMyCommands, which is better because the menu then ships with the code rather than drifting from it. The property most people miss is scoping — setMyCommands accepts a scope, so a bot can present a short menu in private chats, a different one in groups, and an extended set to group administrators. That removes the common problem of admin-only commands being advertised to everyone who cannot use them.

Step by step

How do you set the menu through BotFather?

Send /setcommands, choose the bot, and send the list as one command per line in the form "start - What this bot does". No leading slash, and the description should say what the command does rather than restate its name. It applies within seconds.

Why set it from code instead?

Because a menu configured by hand drifts from the commands that actually exist the first time you ship a change. Calling setMyCommands on startup keeps them in step, which matters most on the commands you removed — an advertised command that no longer works reads as a broken bot.

How do you show different menus in different places?

setMyCommands takes a scope: default, all private chats, all group chats, or all chat administrators. Use it to keep private chats simple, and to advertise moderation commands only to the admins who can run them.

Which commands belong in the menu?

The five or six people use most, in the order they would use them. The menu is a discovery surface, not a manifest — a twenty-item list is scrolled past. Keep the long tail in /help, where it can be organised and explained properly.

What catches people out

  • Descriptions are what people read; "stats - stats" teaches nobody anything
  • A menu set by hand goes stale the first time commands change — set it from code
  • Advertising admin-only commands to everyone generates support questions from people who cannot use them

Questions

Why does the menu not update immediately for me?

Clients cache the command list. It usually refreshes within a minute or two, and reopening the chat helps. If it persists, confirm the scope you set matches the chat type you are testing in.

Can the menu change per user?

Not per individual user, but scoping covers the useful cases — private versus group, and administrators versus members. For genuinely per-user surfaces use inline keyboards instead.

Want a bot that does this?

Describe it in plain language and Botable writes the code, gives the bot its own database, deploys it and keeps it running. Everything on this page is handled for you — the token, the webhook, the storage, the hosting.

Build a bot

Keep reading

Bots that use this

All twenty-five guides