telegram bot configure and add some humanity header image

Bot Dev: How to configure chatbot in Telegram

In previous articles (part 1, part2) we created chatbot for Telegram. As I promised, here we will configure some settings of our bot:

  • commands list
  • profile photo
  • about text
  • bot description

Let’s begin by configuring our commands list.

Commands list

Command list represents the commands supported by the bot. Telegram suggests them when user types / in the chat with our bot. Each command in this list has a name, which starts with ‘/’, and a text description. Command name length is limited to 32 characters.

Let’s check our help command to refresh the memory:

telegram chatbot help command

So we have 2 commands we need to add to our list. Now we go to @BotFather and type /setc. You should see next:

telegram botfather set command

It appears that BotFather also has this command suggestion and that is how it looks like. Let’s click on suggested command.

telegram chatbot set commands select bot

Here you should select which bot you want to configure – in my case it’s @repaitMyStuffBot. Click on it and bot asks you to specify commands list in given format. I’ve entered next text:

fix – submit request. E.g.: /fix desc
myrequests – to get submitted request

After sending a message back to the bot it tells us that operation has been successfully finished.

telegram chatbot set commands provide commands

We are done with the configuration and we can test it. To do this, go to chat with your bot and start to type command. You will get a suggestion from your bot (if there is anything to suggest):

telegram chatbot command list

It works perfectly!

Chatbot profile picture (userpic)

Currently, we have “RS” in a cycle as a profile image, and I do not like this. Let’s put there something more related to our business.

Steps to change profile picture are pretty similar to setting commands list:

  1. Open chat with @BotFather
  2. type /setuserpic
  3. select your bot
  4. use clip icon, which is next to the input field, to upload the image

NOTE: I’ve not found any documentation regarding image size limitation for bot profile picture, but 64x64px and 128x128px will not work:

telegram chatbot set userpic wrong dimensions

But 256x256px works perfectly – chatbot sends us success message:

telegram chatbot set userpic success

Now, to check results you should refresh the page.

telegram chatbot profile photo contact list

Also, profile picture has been updated in Bot profile dialog:

telegram chatbot profile photo profile

 

About text

At this point, we have configured command list and profile picture. But profile dialog looks pretty empty. We should do something with it. About text will be shown in the profile of your bot, so users can see, what is the purpose of this bot.

  1. Open chat with @BotFather
  2. type /setabouttext
  3. choose bot
  4. Write about text

telegram chatbot set about

Now we will check profile page one more time.

telegram chatbot about profile

Description

Another important thing is chatbot description. Do you remember what have you seen when started the chat with your bot for the first time?
It looked smth like this:

telegram bot start windowNot really user-friendly, right? Let’s fix this. Description will be shown for new users before they start a chat. It should be attractive so they will not close chat but start chatting (that is why we are writing bots, right?). As usually:

  1. Open chat with @BotFather
  2. type /setdescription
  3. select bot
  4. type description text

telegram chatbot set welcome description

Finally, if you clean conversation history with this chatbot, refresh the page and open chat you will see our description:

telegram chatbot check welcome description

Much better, right?

Conclusion

In this article, we configured profile picture, about and description texts, commands list. Some of them are needed to improve user experience with our bot, while others – to attract users and force them to use it.

P.S.: will be happy to get questions from you and see you soon.

 

Your thoughts are welcome