Commands, the menu button and inline mode
What it is
Commands start with /; typing / lists them with descriptions. The Menu button next to the message field opens that list or launches a Mini App. Inline mode lets people use your bot in any chat: they type `@your_bot` and a query and pick a result.
How to do it
- Commands: send /setcommands to @BotFather, pick the bot, send one per line: `help - What this bot can do`.
- Support /start and /help, plus /settings if your bot has settings.
- Menu button: /setmenubutton, then the button text and your Mini App's address; by default it opens the command list.
- Inline mode: /setinline, pick the bot and send the placeholder people see after typing its name.
- To use it: type `@your_bot` and a query in any chat and tap a result. The message shows "via @your_bot".
Watch out
- A command is 1โ32 characters: lowercase Latin letters, digits and underscores. A description is 1โ256 characters, and a list holds up to 100 commands.
- The Bot API's setMyCommands gives different lists per scope (private chats, groups, admins, one chat) and language.
- People can send any command, even unlisted ones: check on your server that it exists and they may use it.
- In groups with privacy mode, write `/command@your_bot`.
- Inline answers hold up to 50 results and are cached 300 seconds by default, shared with anyone sending the same query; use `is_personal` for personal results.
With Gem
Gem doesn't set these up: your own bot isn't available on Gem yet. Your project lives in @gembot (/newproject, /myprojects, /dashboard, /newapp), with its Mini App page at `t.me/gembot?startapp=<name>`.
Sources
- https://core.telegram.org/bots/features#commands
- https://core.telegram.org/bots/api#setmycommands
- https://core.telegram.org/bots/inline
- https://core.telegram.org/bots/webapps