Telegram chatbot commands

Telegram has a nice feature that allows you to build chatbot menus (something similar to Persistent menu on Facebook Messenger) from so-called “commands”. These menus can be triggered when user types “/” (slash) in the conversation.

Example of the chatbot menu on Telegram
Example of the chatbot menu on Telegram

You can use commands to trigger specific skills in your chatbot. Just go back to @BotFather on Telegram and type “/setcommands”. The bot will ask you which of your chatbots to use, and then prompt to enter the list of commands.

Each command will trigger a chatbot event with the same name in Activechat.

Type your commands (one per line) with simple descriptions. Please keep in mind that all commands should be contained within a single message, so use “Ctrl+Enter” (or “Cmd+Enter on Mac”) to separate lines, and hit “Send” only after you’ve entered all commands.

Adding a list of commands to your chatbot on Telegram
Adding a list of commands to your chatbot on Telegram

Now if you go to your new chatbot on Telegram and hit “/”, it will display the list of commands with descriptions, and once you click a command, an event with the same name will be sent to your chatbot.

Telegram chatbot commands triggered with "/"
Telegram chatbot commands triggered with “/”

In this example, “/about” command will send “about” event (that will trigger “about” skill in Activechat), “/contact” will send “contact” event, etc.

Best practices for using commands

As with Facebook Messenger Persistent Menus, it makes sense to follow some simple guidelines when designing the lists of commands for your Telegram chatbot.

  • Be descriptive. Chatbot commands tell your users what your chatbot can do, and when designed wisely can immensely increase the retention.
  • Use commands to provide access to key features of your chatbot, adding event buttons to trigger chatbot skills.
  • Keep the list of commands short (unless you’re building a chatbot for some specific use case, where many commands are a must).
Was this article helpful to you? Yes 12 No 12

How can we help?