Back

Telegram chatbot with commands

Chat bot in Telegram — is an automated program that runs inside the Telegram messenger and performs various tasks by interacting with users via text commands or buttons. It can answer questions, provide information, perform automatic actions or interact with other services.

The main characteristics of a chatbot in Telegram:

  1. Automation: The bot automatically responds to user requests based on programmed rules.
  2. Interactivity: The user can interact with the bot through text, pressing buttons or executing commands.
  3. Commands: The main way the user interacts with the bot. Commands can perform various functions such as providing information, running processes, etc.

How to make a chatbot that responds to commands.

First, you need to add the appropriate commands in the bot settings in @BotFather. This requires:

  1. Go to bot @BotFather in Telegram.
  2. Write the command /mybots and choose the bot for which you want to create commands (if you don't have a bot yet, you need to write /newbot and enter its name and uri).
  3. Next, choose the desired bot from the list and click on it.
  4. Click EditBot
  5. Click EditCommands

Create a chatbot with commands

Then you can add the commands needed for the bot and their description.

Don't have your own bot yet? Do you think that creating a chatbot is difficult?

Sign up now at Gerabot chatbot constructors and create your own chatbot in 15 minutes!

Now it is necessary to connect the chatbot to the bot constructor of your choice (we will analyze the creation of the bot's reaction to commands using the Gerabot constructor as an example).

If you are not yet registered on the service, you need to go to the “chatbot designer” and create an account by clicking “Try for free”. After activating the account, go to it and add the token of your bot that you created in @BotFather.

Now you need to create scripts for each bot command you added to BotFather. To create a script, go to the "Chatbot Scripts" section; and perform the following actions:

  1. Click “Add script”.
  2. Fill in the “script name” field.
  3. Fill in the field “answer text” (this is the text that the user will see after executing this or that command).
  4. Fill in the “keywords” field. 

Create a chatbot with commands

It is in the keywords field that you need to write the appropriate command, when running which the bot will display the script. Commands must be written with the sign "/". That is, if you added the “companyinfo” command to @BotFather in the script keywords you need to write “/companyinfo” and, accordingly, the bot will display this script to the user when executing the corresponding command. 

Do you want to know about all Gerabot updates?
Subscribe to our Telegram channel - https://t.me/gerabotua- https://t.me/gerabotua
Keep browsing gerabot.com, You acknowledge that you have read Terms of Use website and agree to use cookies
Get information
about special offers