Home · Templates · Telegram commands

Telegram bot commands: /help, /menu and /contacts without code

A bot with commands, the way Telegram users expect: /start and /menu open a button menu, /help sends the list of commands, /contacts sends contacts, and an unknown command gets a hint. In CHBT a command is caught by the “Keywords” trigger in the “Exact match” mode — that is how you add any command of your own. The “Menu” button with command hints in Telegram itself is set up in @BotFather with the /setcommands command: CHBT does not fill it in for you.

Suitable for: Telegram bots, Channels, Services, Shops

How it works

Step 1/start or /menu
Step 2Button menu
Step 3/help and /contacts
Step 4Not understood — hint

What you can customize

  • Message texts and buttons
  • Fields of the “Data collection” block and format checking
  • Tags, notifications and transmission to the operator
  • Channels: Telegram, MAX, VKontakte, chat on the website
Telegram
MAX
VK
Chat on the site

Sample dialog

Customer
/help
Bot
Bot commands: /menu — menu, /contacts — contacts, /help — list of commands, /start — start over
Customer
/price
Bot
I didn’t understand the command. List of commands — /help

What the template sets up

Five triggers in one flow. The /start command and the keyword /menu open the menu: a “Message” with the “Services and prices”, “Contacts” and “Call a person” buttons. The keyword /help sends the list of commands, /contacts sends the contacts. All three are “Keywords” triggers in the “Exact match” mode: a command fires only when the whole message equals it; letter case does not matter. The last trigger is “Any message”: to an unknown command and to text typed instead of tapping the menu buttons the bot replies “I didn’t understand the command. List of commands — /help”.

The “Services and prices” and “Contacts” texts are placeholders — write your own. “Call a person” hands the conversation to a team member in Conversations through the “Operator” block.

How to add your own command

A command in CHBT is ordinary text sent by Telegram. To add, say, /price: put a “Message” with your price list on the canvas, add a “Keywords” trigger with the word /price, “Exact match” mode, and point it to that message.

The order of triggers in the list doesn’t matter: within a flow, “Any message” is checked last, after all commands and keywords, so a new command works wherever you add it.

For the same reason “Any message” intercepts keywords of flows created after this template: flows are checked in the order they were created. Keep commands in this flow, and create other flows earlier or make a copy of the template after them.

The “Menu” button in Telegram is set in @BotFather

The list of commands with hints that Telegram shows under the “Menu” button to the left of the input field is stored by Telegram itself. CHBT does not fill it in: open @BotFather, send /setcommands, choose the bot and send the list — one command per line, in Latin letters and without the slash: menu - Menu, contacts - Contacts, help - List of commands. The commands in this list and the triggers in CHBT must match: a menu command without a trigger gets the reply “I didn’t understand the command”. Step-by-step bot settings in @BotFather — in the article how to create a Telegram bot.

Other channels

Slash commands are a Telegram habit. In MAX, VK and the website widget the same triggers fire if a person types the command themselves, but there the first message from a new contact is usually plain text, and “Any message” will reply to it with “I didn’t understand the command”. For these channels the “Welcome and menu” template is more convenient. Connecting the bot — in the help article how to connect a Telegram bot. Open the template in your account.

Frequently asked questions about the template

Will CHBT add the commands to the Telegram menu?

No. The “Menu” button with commands is set up in @BotFather with the /setcommands command. CHBT replies to commands with “Keywords” triggers in exact match mode.

Why doesn’t a new command fire?

Check the trigger’s match type: it must be “Exact match”, and the message must consist of the command only — “/price” with no other words. Another reason: the flow is off, or another flow with “Any message” was created before it — flows are checked in creation order.

Do commands work on the Free plan?

Yes, keywords, the menu and handoff to an operator work on any plan. The Free plan includes 30 conversations per month per bot and one operator.

Similar templates

Ready to launch “Telegram commands»?

Use template