avatarKev the Dev

Summary

The web content provides a comprehensive guide on setting up a Telegram bot using BotFather, including naming, profile picture, description, about text, and commands.

Abstract

The article on the undefined website serves as a step-by-step tutorial for creating and customizing a Telegram bot using the BotFather bot on Telegram. It begins with an introduction to BotFather and its role in managing Telegram bots, followed by detailed instructions on how to register a new bot, which includes choosing a name and a unique username. The guide emphasizes the importance of keeping the bot's token secure and provides steps for updating the bot's profile picture, description, and about text to enhance user understanding of the bot's functionality. Additionally, it explains how to set up a list of commands for the bot, making it easier for users to interact with the bot through a menu. The article concludes with an invitation for feedback and a link to more resources on Telegram bot development.

Opinions

  • The author suggests that a unique username and an engaging profile picture are crucial for a bot to stand out.
  • The article implies that the bot's description and about text are important for informing users about the bot's purpose and capabilities upon their first visit.
  • The author points out a quirk in Telegram's design where the 'description' in the Bot Info page is actually set using the /setabouttext command, expressing slight confusion over this design choice.
  • The author emphasizes the importance of not sharing the bot's token to maintain control over the bot.
  • The use of the 'Menu' button for easy access to bot commands is recommended as a user-friendly feature.

How to set up your Telegram Bot using BotFather

In this article, I will show you how to setup a new Telegram bot and its profile picture, description, about text and commands!

Photo by Lana Codes on Unsplash

Who is BotFather?

BotFather is a bot on Telegram that manages all the bots that you create via your account on Telegram. You can reach him by searching @BotFatheron Telegram and you should see this profile

To see what he can do, send /start or /help in the chat with BotFather, and you should see a list of commands that he has.

1. Creating a new bot

The very first step when creating a new Telegram bot project, is to register your new bot with BotFather. We are going use a Todo list bot as an example.

1. Send /newbot to BotFather

2. Reply BotFather with the name of the bot you wish to use.

Note that this will be the name of the bot that will appear in your conversations and it does not need to be unique

3. Next, reply BotFather with the username of the bot you wish to use for your bot

The username is a unique identifier for your bot, and so it has to be unique to all other bots. It will also be appended with a ‘@’ at the front, and is usually how people will find your bot. Note that the username of a bot has to end with the word bot, and BotFather will ask you to try again if it does not meet that criteria, or if your username is not unique.

4. At this point, your bot should have been created!

In the reply, you should be able to see the bot’s token. This is very important when creating new bots, and make sure that you do not give this token to anyone, as whoever has this token can take control over your bot. (Don’t worry, I have deleted this example bot so there is no point in copying my token in the screenshot :P)

Click on the t.me/<bot_username> link, and you should be brought straight to your new telegram bot. You should see the name of your new bot at the top of the chat display, and you should also see the bot's username in the Bot Info page.

If at any point you need to access your bot’s access token again, send /mybots to BotFather, click on the bot's username, click on API Token in the inline keyboard, and you should be able to see the bot's token again.

2. Adding a Profile Picture

To make your bot stand out from other bots, it needs to have a profile picture.

1. From the BotFather chat, send /setuserpic or you can the 'Menu' button on the left if the chat box, and scroll down to /setuserpic. All commands should be in the menu so you can use the menu whenever you need to send a command.

2. Click on your bot’s username

3. Upload a picture to BotFather (image must be at least 150x150)

4. Once you’ve uploaded your picture, go back to your new bot, and it should have its profile picture updated! Nice!

3. Setting the Bot’s Description

If you’re looking at this picture and find that it is missing something, you’re right, it is missing the bot’s description. The description is usually shown whenever a person visits the bot for the first time, and it will be seen with the header ‘What can this bot do?’. This is very important to set up as you want your users to know immediately what is the bot’s function right as he visits the bot.

To set the bot’s description, it is similar to the step above. Send /setdescription to BotFather and follow the instructions.

Now for some strange reason, if you want your bot to have the ‘description’ section in the Bot Info page, this ‘description’ is actually the bot’s ‘About’ text, and to set it, use the /setabouttext command. Don't ask me why its designed this way, I have no idea too.

4. Setting the Bot’s Commands

It’s good to provide users with a list of available commands for your bot via the ‘Menu’ button on the left. This also saves them the need of typing the entire command out.

To get this for your bot, we want to send /setcommands to BotFather and select our bot.

Assuming we have 3 commands /new, /edit, and /delete, what you need to reply back to BotFather is a list of your commands and their description in the following format:

new - Create a new todo
edit - Edit an existing todo
delete - Delete a todo

Note that we exclude the slash for the command, and we use a dash (-) to separate between the command and its description.

Now your bot should have their commands easily accessible through the ‘Menu’ button! Awesome!

That’s all folks!

I hope this article was helpful in explaining the features of BotFather! Please feel free to leave a follow or a clap if this helped you and comment what you would like to learn next about Telegram bots! I specialise in Telegram bot development and free deployment tips and tricks, do checkout my other article on Telegram bots here: https://blog.devgenius.io/create-and-deploy-your-telegram-bot-here-entirely-free-757d5d5e8099

Telegram
Software Development
Telegram Bot
Programming
Software Engineering
Recommended from ReadMedium