Building a Telegram bot is a straightforward process, especially when using the Telebot module in Python. In this first part of our series, we will focus on the initial setup within the Telegram app itself. Before we write a single line of code, we need to register our bot and obtain an API key.
Step 1: Find @BotFather
The first step is to open Telegram (either on desktop or mobile) and search for @BotFather. This is the official Telegram bot used to create and manage all other bots.
Pro Tip: Ensure you select the account with the blue verified checkmark to avoid unofficial or scam accounts.
Once you open the chat, click the Start button. You will see a list of commands. While BotFather allows you to manage settings, edit descriptions, or even develop games, we are interested in one specific command: /newbot.
Step 2: Naming Your Bot
After selecting /newbot, BotFather will ask for two specific pieces of information:
- The Name: This is the display name of your bot (e.g.,
W3Camp). It does not have to be unique and can be changed later. - The Username: This must be unique across the entire Telegram platform and must end in “bot”. For example,
W3Camp_botorTetrisBot.
Once you have chosen a unique username, BotFather will send a “Congratulations” message.
Step 3: Secure Your API Token
The most critical part of the confirmation message is the HTTP API Access Token. This long string of characters is your “key” to the bot.
- Store it safely: You will need this token in your Python code to authenticate your script with the Telegram servers.
- Keep it private: Anyone with this token can control your bot.
Step 4: Configuring Bot Commands
To make your bot user-friendly, you should define a few standard commands. You can do this by going to Edit Bot > Edit Commands within BotFather.
Commands follow a specific format: command - description. For a professional look, you might set up the following:
start - Start the bothelp - Get assistancecontact - Get in touch with the creator
After setting these, when a user opens your bot, they will see a convenient menu listing these options.
Step 5: What’s Next?
At this stage, if you find your bot and click “Start,” nothing will happen. This is because the bot is currently a “shell.” To make it functional, you need a script running on a server or your local machine.
In the next part of this series, we will write the Python code to:
- Connect to the Telegram API using your token.
- Listen for incoming messages.
- Process commands and send automated responses.


