Skip to main content
Share
Guides

Telegram Bot Commands: setMyCommands, Scopes, Menu Button and Deep Links

Registering commands is how users discover what your bot does. The exact BotFather format, the naming limits, all seven BotCommandScope types and the order Telegram resolves them in, localized lists, the menu button, /start payloads and how commands behave in groups.

Content & Engineering
Oct 13, 2026
16 min read
Updated Nov 2026Last verified November 2026
telegram bot commandssetmycommandsbotfather setcommandstelegram bot menu buttontelegram bot commands list
TL;DR

Registering commands is how users discover what your bot does. The exact BotFather format, the naming limits, all seven BotCommandScope types and the order Telegram resolves them in, localized lists, the menu button, /start payloads and how commands behave in groups.

Key Takeaways
  • You set a Telegram bot's command list either in @BotFather with /setcommands , sending one command - description pair per line, or from code with the Bot API method setMyCommands .
  • Each command is 1-32 characters of lowercase English letters, digits and underscores, each description is 1-256 characters, and one list holds at most 100 commands.
  • Last verified: November 2026 against the Bot API reference (through Bot API 10.3) and Telegram's bot features guide .
  • The registered list is what Telegram apps show when a user types / and what the menu button next to the message field opens.

Two ways to set Telegram bot commands

You set a Telegram bot's command list either in @BotFather with /setcommands, sending one command - description pair per line, or from code with the Bot API method setMyCommands. Each command is 1-32 characters of lowercase English letters, digits and underscores, each description is 1-256 characters, and one list holds at most 100 commands.

Last verified: November 2026 against the Bot API reference (through Bot API 10.3) and Telegram's bot features guide.

The registered list is what Telegram apps show when a user types / and what the menu button next to the message field opens. It does not create any behavior by itself: your code still has to handle /help when it arrives. Registering commands is about discoverability, and a bot with no registered commands leaves users guessing.

BotFather /setcommandssetMyCommands API
Best forA single static list, set once by handLists in code, per audience, per language, in CI
Scopes (private, groups, admins, one chat)No, sets the default listYes, seven scope types
Per-language listsNoYes, via language_code
Ephemeral flagNoYes, is_ephemeral on each command
ReversibleRe-run with a new listdeleteMyCommands per scope and language

BotFather /setcommands: the exact format

  1. Open @BotFather and send /setcommands (or go through /mybots, pick the bot, then Edit Bot and Edit Commands).
  2. Choose the bot from the list.
  3. Send the whole list as one message, one command per line, command first, then a space, a hyphen, a space and the description.
start - Start the bot and see what it can do
help - How to use this bot
order - Check the status of an order
support - Talk to a person
settings - Language and notification settings
cancel - Cancel the current action

Write the command names without the leading slash, the way Telegram's own tutorial does. Sending /setcommands again replaces the whole list rather than appending to it, so always paste the complete set. The list you set here is the default list, equivalent to setMyCommands with the default scope and no language.

If a line is rejected, the cause is almost always the name: a capital letter, a hyphen, a space or a non-Latin character in the command itself. Descriptions are free text and can be written in any language.

Command naming rules and limits

The limits below come from the BotCommand object and setMyCommands in the Bot API reference. They apply to commands you register; Telegram's features guide notes that commands users type can contain Latin letters, numbers and underscores, but only lowercase names are accepted in the registered list.

FieldRule
command1-32 characters; lowercase English letters, digits and underscores only; no leading / in the API object
description1-256 characters
is_ephemeralOptional boolean; marks a command whose message only the sender and the bot can see
Commands per listAt most 100 per setMyCommands call (one scope plus language combination)
language_codeTwo-letter ISO 639-1 code, or empty for the fallback list

Telegram's guidance is to make commands specific: /newlocation and /newrule rather than a generic /new that then asks a follow-up question. Specific commands are self-documenting in the menu and remove a conversational round trip. Keep names short enough to type on a phone; 32 characters is a ceiling, not a target.

Telegram asks every bot to support three global commands, and its apps add interface shortcuts for them:

  • /start begins the interaction and carries deep-link parameters.
  • /help explains what the bot does and lists its commands.
  • /settings, if applicable, shows the user's settings and how to change them.
Try it yourself
Build your first chatbot free
Free plan, no credit card required. Live on your site in about 10 minutes.
Start building free

setMyCommands: setting commands from code

setMyCommands takes a JSON array of BotCommand objects plus optional scope and language_code. It returns true on success. Sending JSON in the body is cleaner than the URL query string because the list nests:

curl -s https://api.telegram.org/bot<TOKEN>/setMyCommands \
  -H "Content-Type: application/json" \
  -d '{
    "commands": [
      {"command": "start",   "description": "Start the bot"},
      {"command": "help",    "description": "How to use this bot"},
      {"command": "order",   "description": "Check an order"},
      {"command": "support", "description": "Talk to a person"}
    ]
  }'

Run it at deploy time, not on every process start. The list is stored by Telegram per bot, so calling it from each of twenty workers on boot does nothing useful and burns requests. A small script in your release pipeline that sets every scope and language you support keeps the menu in version control alongside the handlers it describes.

The rest of the family:

MethodWhat it does
getMyCommandsReturns the list for a given scope and language as an array of BotCommand; an empty array if none is set
deleteMyCommandsDeletes the list for a given scope and language; affected users then see the next, broader list
setChatMenuButtonChanges what the menu button does, per private chat or as the bot default
getChatMenuButtonReturns the current menu button for a private chat or the default

Remember that deleteMyCommands with no arguments only deletes the default list. If you set lists for groups, admins or specific languages, each needs its own delete call with the same scope and language_code.

BotCommandScope: different menus for different users

Scopes let one bot show a short menu to customers in private chats, a moderation menu to group admins, and a different list in one specific group. The API defines exactly seven scope types:

Scope objecttype valueExtra fieldsCovers
BotCommandScopeDefaultdefaultNoneEveryone, when no narrower list applies
BotCommandScopeAllPrivateChatsall_private_chatsNoneAll one-to-one chats with the bot
BotCommandScopeAllGroupChatsall_group_chatsNoneAll groups and supergroups
BotCommandScopeAllChatAdministratorsall_chat_administratorsNoneAdministrators of all groups and supergroups
BotCommandScopeChatchatchat_idOne specific chat
BotCommandScopeChatAdministratorschat_administratorschat_idAdministrators of one group or supergroup
BotCommandScopeChatMemberchat_memberchat_id, user_idOne member of one group or supergroup

chat_id accepts a numeric ID or a supergroup @username; the reference notes that channel chats and channel direct-message chats are not supported for the chat-based scopes. A moderation menu for admins everywhere looks like this:

curl -s https://api.telegram.org/bot<TOKEN>/setMyCommands \
  -H "Content-Type: application/json" \
  -d '{
    "scope": {"type": "all_chat_administrators"},
    "commands": [
      {"command": "warn",  "description": "Warn the replied-to user"},
      {"command": "mute",  "description": "Mute the replied-to user"},
      {"command": "stats", "description": "Group activity summary"}
    ]
  }'

Which list a user actually sees

Telegram resolves the menu by walking a fixed order and returning the first list that is set. Lists do not merge: if an admin list exists, admins see only that list, not the admin list plus the group list. Repeat shared commands such as /help in every list.

In a private chat with the botIn a group or supergroup
1. chat + language1. chat_member + language
2. chat2. chat_member
3. all_private_chats + language3. chat_administrators + language (admins only)
4. all_private_chats4. chat_administrators (admins only)
5. default + language5. chat + language
6. default6. chat
7. all_chat_administrators + language (admins only)
8. all_chat_administrators (admins only)
9. all_group_chats + language
10. all_group_chats
11. default + language
12. default

Scopes control what is shown, not what is allowed. The features guide is explicit that updates carry no information about the scope a command came from, and may contain commands that do not exist in your bot at all. Anyone can type /mute. Check the sender's rights in your handler, for example with getChatMember, before acting on a privileged command.

Telegram Bot Token Checker
Free tool - no signup, runs in your browser.
Open free tool

Handling commands in code: python-telegram-bot, aiogram, grammY and Telegraf

Registering a command makes it visible; a handler makes it do something. Each major library has a command router, and each makes slightly different choices about arguments, @botname suffixes and edited messages. Those differences explain a surprising share of "my command handler misbehaves" reports.

# python-telegram-bot (v20+)
from telegram.ext import Application, CommandHandler, filters

async def order(update, context):
    if not context.args:                 # "/order 8812" -> ["8812"]
        await update.message.reply_text("Usage: /order <number>")
        return
    await update.message.reply_text(f"Looking up order {context.args[0]}")

app.add_handler(CommandHandler(
    "order", order,
    filters=~filters.UpdateType.EDITED_MESSAGE))   # see below

# aiogram 3
from aiogram.filters import Command, CommandObject

@router.message(Command("order"))
async def order(message, command: CommandObject):
    await message.answer(f"Looking up order {command.args}")  # None if no args

// grammY
bot.command("order", (ctx) => ctx.reply(`Looking up order ${ctx.match}`));

// Telegraf
bot.command("order", (ctx) => ctx.reply(`Looking up order ${ctx.payload}`));
LibraryArguments arrive as/cmd@other_botEdited messages
python-telegram-bot CommandHandlercontext.args, a list split on whitespaceIgnoredHandled by default; exclude with ~filters.UpdateType.EDITED_MESSAGE
aiogram Command filtercommand.args, the raw string or NoneIgnored unless ignore_mention=TrueOnly if you register the handler on edited messages
grammY bot.command()ctx.match, the string after the commandIgnored; /cmd and /cmd@your_bot both matchNot by default
Telegraf bot.command()ctx.payload (string) or ctx.args (array)Ignored; the username comparison is case-insensitiveNot by default

The edited-message default in python-telegram-bot is the one that bites. Its documentation says CommandHandler "listens to messages as well as edited messages", so a user who fixes a typo in /refund 8812 triggers the handler a second time. For read-only commands that is harmless; for anything that places an order, sends a message to a third party or changes state, add the filter shown above. The same documentation notes that CommandHandler does not handle channel posts or commands in media captions; those need a MessageHandler with suitable filters.

All four routers only treat a command at the very start of the message as a command. grammY's guide spells it out: in "Please do not send /start to that bot!" the /start handler is not called. aiogram's Command filter also accepts ignore_case=True if you want /Order to match, which matters because users can type capital letters even though registered command names must be lowercase.

Parsing commands without a library: use the bot_command entity

If you are writing against the raw Bot API, do not detect commands with text.startsWith("/"). Telegram already parsed the message for you: every command in a message comes with a MessageEntity of type bot_command, with an offset and length measured in UTF-16 code units. A command at the start of the message has offset 0.

function parseCommand(message, botUsername) {
  const e = message.entities?.[0];
  if (!e || e.type !== "bot_command" || e.offset !== 0) return null;

  // offset/length are UTF-16 code units, which is how JS strings index too
  const raw = message.text.slice(0, e.length);        // "/order@acme_bot"
  const [cmd, target] = raw.slice(1).split("@");
  if (target && target.toLowerCase() !== botUsername.toLowerCase()) return null;

  return { command: cmd.toLowerCase(), args: message.text.slice(e.length).trim() };
}

The UTF-16 detail matters outside JavaScript. In Python, len() and slicing count code points, so an emoji before an entity shifts every offset after it; Telegram's offsets only line up with Python string indexes when the text has no characters outside the Basic Multilingual Plane. For a command at offset 0 this is rarely an issue, but the same parser reused for links or mentions later in the message will be off by one per emoji unless you encode to UTF-16 first. Treat the argument string as untrusted user input, exactly as with a deep-link payload: validate it, length-limit it, and never pass it straight into a database query or shell command.

Localized command lists with language_code

Pass language_code with a two-letter ISO 639-1 code and the list applies only to users whose Telegram app language matches. Leave it empty and the list becomes the fallback for that scope, used for every language you have not covered. A sensible setup is an English (or primary-market) list with no language_code, plus one call per translated language:

{
  "language_code": "es",
  "commands": [
    {"command": "start", "description": "Iniciar el bot"},
    {"command": "help",  "description": "Cómo usar este bot"},
    {"command": "order", "description": "Consultar un pedido"}
  ]
}

Translate descriptions, not command names. Command names are restricted to lowercase English letters, digits and underscores in every language, and keeping /order identical everywhere means one handler, consistent support documentation, and links that work for everyone. The same applies per scope: language-specific lists sit above the plain list at every level of the resolution order shown above.

Commands, reply keyboards, inline keyboards or a Mini App?

Commands are one of four ways a Telegram bot can offer choices, and the features guide treats them as complementary. Picking the right one for each interaction is most of good bot design:

InterfaceWhat the user doesWhat your bot receivesBest for
CommandsTypes / or opens the menu and picks oneA message with a bot_command entityEntry points and power-user shortcuts: /start, /help, /order
Reply keyboard (ReplyKeyboardMarkup)Taps a button that replaces the phone keyboardA plain text message with the button label, or a shared contact, location or chatShort multiple-choice answers inside a flow; one_time_keyboard hides it after use
Inline keyboard (InlineKeyboardMarkup)Taps a button under one of the bot's messagesA callback_query (no message is sent to the chat)Menus, pagination, settings toggles, confirmations
Mini AppOpens a web interface inside TelegramData from the web appCatalogs, forms and checkout flows too rich for buttons

A practical split for most business bots: a handful of commands as stable entry points, inline keyboards for every choice after that, and reply keyboards only when the answer should appear in the chat history (a shared phone number, a yes or no the user will want to scroll back to). Telegram recommends editing an inline keyboard in place when the user toggles a setting or changes page, rather than sending a new message each time.

Inline buttons come with their own limits and errors: callback_data is 1-64 bytes, a callback query must be answered with answerCallbackQuery or the user sees a spinner, and answering too late returns query is too old. Oversized payloads fail with BUTTON_DATA_INVALID, and editing a keyboard to an identical one returns message is not modified. The keyboard builder checks the byte limits as you lay buttons out, and the text formatter produces the escaped text that goes above them.

Commands in groups: @botname and privacy mode

In a group with several bots, /help is ambiguous. Telegram's convention is the suffixed form /help@your_bot, which the docs list as a command "explicitly meant" for that bot. Your parser should accept both forms and should ignore commands addressed to a different bot.

/order 8812            -> command "order", args "8812"
/order@your_bot 8812   -> same, explicitly addressed to you
/order@other_bot 8812  -> not for you, ignore

Privacy mode decides which of those messages reach you at all. It is on by default, and a bot in privacy mode receives, per the docs:

  • commands explicitly meant for it, such as /command@this_bot;
  • general commands such as /start, if this bot was the last bot to send a message to the group;
  • inline messages sent via the bot, and replies to messages meant for it;
  • plus, regardless of privacy mode, all service messages.

So a bare /help in a busy group with other bots may never arrive. Bots added as administrators receive all messages. Disabling privacy mode with BotFather's /setprivacy also works, but the change only takes effect after the bot is removed and re-added to the group, a step that accounts for many "it works in DMs but not in my group" reports covered in why a Telegram bot is not responding.

Ephemeral commands

Bot API 10.2 (July 2026) added an optional is_ephemeral field to BotCommand. When a command is declared ephemeral, the user's message invoking it is delivered to your bot but stays invisible to other group members and other bots, so someone can run /balance in a public group without broadcasting it. Bots can answer with ephemeral messages visible only to that user. The details and timing rules are in our Bot API 10 breakdown.

Errors command handlers hit, and what each one means

The handler runs, tries to reply, and the Bot API says no. These are the errors that show up most often in command handlers specifically, because commands are where a bot first talks to a new chat:

ErrorTypical command-handler causeFix
403 bot was blocked by the userReplying to a user who blocked the bot after sending the commandCatch it, mark the user inactive, stop messaging them
403 bot can't initiate conversationA group command handler tries to DM a user who never pressed StartReply in the group with a ?start= deep link instead
400 chat not foundA stored chat_id from another bot, or a typoUse the chat.id from the incoming update
400 group chat was upgraded to a supergroupThe group became a supergroup and got a new IDRead migrate_to_chat_id from the error and update your records
400 can't parse entities/help text with unescaped Markdown or HTMLEscape the reply or drop parse_mode
400 message is too longA /list or /help reply over 4,096 charactersSplit the reply or paginate with an inline keyboard
429 Too Many RequestsA broadcast command, or many users running a command at onceWait the retry_after seconds, then queue sends

The supergroup case catches long-running group bots: the error's parameters object carries migrate_to_chat_id, which the Bot API notes can have more than 32 significant bits, so store chat IDs as 64-bit integers. The rest of the catalogue, with the literal error strings to search your logs for, is in the Telegram error directory and the Bot API error codes guide.

A command setup checklist

  1. Handle /start, /help and, if you have settings, /settings. Make /start work with and without a payload.
  2. Name commands with lowercase letters, digits and underscores, 32 characters or fewer, and make each one specific.
  3. Set the default list, then narrower lists only where the audience truly differs. Repeat shared commands in every list, because lists do not merge.
  4. Add language_code lists for translated descriptions, keeping command names identical.
  5. Set lists from a deploy script with setMyCommands, and verify with getMyCommands for each scope.
  6. Enforce permissions in the handler; scopes only hide menu entries.
  7. Parse /cmd@your_bot and ignore commands addressed to other bots.
  8. Decide whether edited messages should re-run a command, and filter them out where they should not.
  9. Decide deliberately between the commands menu button and a Mini App button.

Message length, callback data, polling and request ceilings that commands run into are collected on the Telegram limits page, and any error string a command handler hits is explained in the Bot API error codes guide. If you are still at the very first step, how to get a Telegram bot token covers BotFather and token safety, and the token checker confirms the token works before you register a single command.

Where Telegram earns its place as a business channel

A short, well-scoped command menu is often the whole user interface of a business bot on Telegram: /order, /support and /settings do more for a customer than a long welcome message. That shape shows up again and again in the industries where Telegram works as a real channel - ecommerce order tracking and cart recovery, logistics dispatch and driver updates, education announcements and course Q&A, media subscriptions, nonprofit volunteer coordination and technical support for developer audiences.

Deep links do the acquisition work: a ?start= payload on an ad, a QR code on a parcel or a link in an email tells you exactly where each conversation came from, and the link generator builds them. Our guides to Telegram for business and Telegram bots for customer support cover the conversation design behind the menu, and ready-made Telegram templates give you a working starting point.

Avoiding this class of problem entirely

Commands look simple until you own all of it: the registered lists per scope and language, the router, the edited-message and @botname edge cases, permission checks, escaping, rate limits and the webhook underneath. None of that is what makes your bot useful to customers, and every chat platform has its own version of it - Discord has slash commands with their own registration and permission model (see Discord bot not responding), and Slack has its own token types and scopes (see Slack bot token types).

A managed platform handles the transport so you can work on the conversation. With Conferbot's Telegram channel, available on every plan including Free, you connect a bot token and build the flow in a visual editor - webhook registration, retries, rate limiting and message formatting are handled for you, and buttons adapt to each platform automatically. The same flow deploys to WhatsApp, Discord, Slack and a website widget without rewriting it per platform, with every conversation in one omnichannel inbox and live chat handover when a person needs to step in.

Start free with Conferbot - the free plan includes 600 conversations a month and needs no credit card, so you can have the same flow running on a second channel this afternoon.

If you are wiring commands by hand today, start with the checklist above and the scope resolution table - most "missing command" reports are a narrower list shadowing the one you set. If you find yourself building the same router for a third channel, that is the point where a platform starts paying for itself.

Share this article:

Was this article helpful?

Ready to build your chatbot?

Join the businesses. Deploy on website, WhatsApp, and 11 more channels in minutes. Free forever plan available.

No credit cardNo coding13+ channels
Start Building Free

Get chatbot insights delivered weekly

Join 5,000+ professionals getting actionable AI chatbot strategies, industry benchmarks, and product updates.

🎯Automate this with a free chatbot

Build and deploy in 10 minutes. No coding needed.

❓FAQ

Telegram Bot Commands FAQ

Everything you need to know about chatbots for telegram bot commands.

🔍
Popular:

Send /setcommands to @BotFather, choose your bot, and send the full list in one message with one command per line in the format "command - description", without the leading slash. Alternatively call the Bot API method setMyCommands with a JSON array of objects containing command and description. Both replace the existing list rather than appending, so always send the complete set.

A registered command must be 1-32 characters long and can contain only lowercase English letters, digits and underscores. Hyphens, spaces, capital letters and non-Latin characters in the command name are rejected. The description is separate, can be 1-256 characters, and can be written in any language, which is where localization belongs.

setMyCommands accepts at most 100 commands per list. Because a list is stored per scope and per language code, a bot can show different sets of up to 100 commands to private chats, groups, administrators or specific chats, and per language. In practice menus with more than a dozen entries are hard to scan on a phone, so most bots keep the visible list short.

BotCommandScope tells setMyCommands which users a command list applies to. There are seven types: default, all_private_chats, all_group_chats, all_chat_administrators, chat, chat_administrators and chat_member. Telegram picks the first list that is set when walking from the narrowest scope to the default, and lists never merge, so shared commands must be repeated in every list.

Check getMyCommands with the same scope and language you set; a list set for one scope is invisible elsewhere. Confirm a narrower list is not shadowing yours, because Telegram shows only the first matching list. Also confirm the menu button has not been switched to a Mini App with setChatMenuButton. Also check that you are testing with the account, chat type and app language the list targets.

Call deleteMyCommands with the scope and language_code of the list you want removed. With no arguments it deletes only the default list. After deletion, affected users see the next broader list in the resolution order, or no list at all. You can also replace the list by sending a new, shorter one with /setcommands or setMyCommands.

Call setChatMenuButton with a menu_button object of type commands, web_app or default. Omit chat_id to change the bot's default button for all private chats, or pass a chat_id to override it for one user. A web_app button needs text and a web_app object with the Mini App URL. getChatMenuButton returns the current setting.

Append ?start=value to the bot link, as in https://t.me/your_bot?start=promo42, and your bot receives the message /start promo42. The value may use A-Z, a-z, 0-9, underscore and hyphen, up to 64 characters; base64url is recommended for binary data. For groups, ?startgroup=value lets the user add the bot to a group and delivers /start@your_bot value.

Privacy mode is on by default, so the bot only receives commands explicitly addressed to it, such as /help@your_bot, general commands if it was the last bot to post, and replies to its messages. Make the bot an administrator, or disable privacy with /setprivacy in BotFather and then remove and re-add the bot, because the setting only applies after re-adding.

No. Scopes only control which commands appear in a user's menu. Telegram's documentation notes that updates contain no information about scope and may include commands your bot never registered. Anyone can type an admin command by hand, so your handler must check the sender's rights, for example with getChatMember, before executing a privileged action.

Some libraries handle edited messages as commands. python-telegram-bot's CommandHandler listens to both messages and edited messages by default, so editing /refund 8812 to fix a typo triggers the handler again. Pass filters=~filters.UpdateType.EDITED_MESSAGE to CommandHandler for commands that change state. aiogram, grammY and Telegraf only handle edited messages if you register a handler for them.

Each library exposes it: python-telegram-bot puts a whitespace-split list in context.args, aiogram passes a CommandObject whose args field is the raw string or None, grammY puts the string in ctx.match, and Telegraf offers ctx.payload as a string and ctx.args as an array. With the raw Bot API, use the bot_command entity at offset 0 and take the text after its length. Treat the arguments as untrusted input.

About the Author

Content & Engineering

The Conferbot team writes about building, deploying, and improving AI chatbots.

View all articles
Skip the blank canvas
Start from one of 250+ free chatbot templates for lead generation, support, e-commerce, and 20+ industries - customize and launch in minutes.
Browse free templates

Related Articles

From the reference shelf

Fact-checked reference pages and free tools for the platform this article covers.

Omnichannel Platform

One Chatbot,
Every Channel

Your chatbot works seamlessly across WhatsApp, Messenger, Slack, and 6 more platforms. Build once, deploy everywhere.

View All Channels
Conferbot
online
Hi! How can I help you today?
I need pricing info
Conferbot
Active now
Welcome! What are you looking for?
Book a demo
Sure! Pick a time slot:
#support
Conferbot
New ticket from Sarah: "Can't access dashboard"
Auto-resolved. Password reset link sent.