
BotFather is Telegram's own bot for creating bots: a new bot gets a name, a username and a token there. On its own the bot answers nobody. Replies come from a separate program that connects to the bot using the token. The program is written by your developer or provided by a third-party service.
Open @BotFather from the Telegram account that will own the bot, usually the company's. Send /newbot and answer two questions, the bot's name and its username, and BotFather replies with the token. Its Mini App does the same in a simpler interface.
The name is the bot's display name, and /setname changes it later. The username is the bot's address in search, mentions and t.me links: 5 to 32 Latin letters, underscores and digits, ending in "bot", as in cafe_orders_bot. Unlike the name, the username ending in "bot" cannot be changed. With Telegram Premium, you can add a secondary username with another allowed ending, such as app; Telegram shows the available endings when you choose it. This secondary username can be removed and replaced. By default, one account can have only two such usernames across all its bots.
The token is the key a program uses to act as the bot. Whoever has the token can run the bot: receive its messages, answer them and change its profile, and Telegram treats their actions as the owner's. Give it only to the person or service that runs the bot's program. If it leaks, or a contractor who had it leaves, send /token for a new one and pass it to the program.
In BotFather, the owner's account issues new tokens, transfers the bot and can delete it, so the bot should belong to the company. If a developer or an agency registers it on their own account, have them transfer it to the company through /mybots. Before that, press Start in the bot from the company account: a bot can be transferred only to someone who has used it. The transfer is permanent.
Your own developer can write the program starting from Telegram's tutorial at core.telegram.org/bots/tutorial, which is in Java and has the same examples in C#, Python, Go and TypeScript.
Instead of your own developer, you can use a third-party service: a bot builder or a bot that creates and manages bots for its users. Such a service holds your bot's token and sees customer messages. Before connecting it, ask whether it deletes a customer's data on request, unless the law requires retaining it, and keeps stored data encrypted: Telegram requires both from the bot's owner.
The program also has to stay online. A personal computer suits testing, but for customers the program runs on a server that is always on, such as a rented virtual server (VPS).
The description appears under "What can this bot do?" until the user presses Start. The about text says what the bot is for and stays on the profile after Start.
| What you set | Command in BotFather | Where people see it |
|---|---|---|
| Description, up to 512 characters | /setdescription | In the empty chat, before Start |
| About text, up to 120 characters | /setabouttext | On the bot's profile and with a shared link |
| Profile picture | /setuserpic | In the chat list, where it helps people spot the bot |
| Commands, up to 32 characters each | /setcommands | In the suggestions after typing / and in the menu next to the message field |
Telegram asks every bot to support /start, which begins the conversation, and /help, which says what the bot does and lists its commands. Commands use lowercase Latin letters, underscores and digits, such as /prices.
For a shop with delivery, the first scenario can look like this.
| The customer | The bot |
|---|---|
| Presses Start | Greets in two lines and shows three buttons in place of the keyboard: Prices, Delivery, Ask a person |
| Taps Prices or Delivery | Sends the ready answer and the buttons again |
| Taps Ask a person, then types the question | Posts the question in the staff group with the customer's name |
| Sends /help | Says what the bot does and lists its commands |
| Writes anything else | Replies briefly and shows the buttons, so no message goes unanswered |
In the Ask a person step, one more such button can ask for the customer's phone number. The Prices answer can carry a button under the message that opens the price list on your site.
The questions arrive in a staff group that includes the bot. A staff member answers by replying to the bot's message there, and the bot passes the answer to the customer. By default a bot in a group sees replies to its own messages but not the ordinary chat. Have the developer build this part: the program has to link each question posted in the group to the customer's ID to know whom the answer is for.
Test it all on a second bot registered in BotFather and running the same program with its own token, so customers never see unfinished replies.
Once the bot works, it can be promoted with Telegram Ads. We explain the setup in our article on promoting a bot.
We are a Telegram Ads reseller. In Adstat, an ad in an agency or reseller account, ours included, can lead to the bot. The report shows each ad's spend, bot starts and cost of a start, grouped by day or in five-minute intervals, and downloads as an Excel or CSV file. It ends at Start: what people do in the bot afterwards, only the bot's program can record.
Every bot needs a privacy policy that users can easily reach, saying what data it stores, how it collects it and why. A bot without its own policy falls under Telegram's Standard Privacy Policy for Bots and Mini Apps. The owner then answers for whether that text fits the bot and local law.
Ask the developer or the service which data the bot collects, such as names, phone numbers and user IDs, and compare the list with the standard text at telegram.org/privacy-tpa. If the text leaves something out or conflicts with your local law, set your own policy in BotFather.
Collect only the data the bot needs to work. Delete a person's data when they ask, unless the law requires you to retain it. Store the data encrypted, with the encryption key kept apart. The bot must not spam people or ask for their Telegram password or login code. Telegram removes a bot that mishandles data from the platform.
The bot's link is t.me/ followed by the username. Put it where customers already look, such as a post in your channel, the website, the email signature or a printed card at the counter.
To see which place brings people, give each link its own start parameter, a short label after ?start=, such as t.me/cafe_orders_bot?start=channel for the channel. When someone opens the bot through such a link and presses Start, the bot receives /start with the label. Telegram keeps no list of the bot's users, so you can count how many people came through each link only if the program stores the label with each user's ID.
Is a Telegram bot free?
Telegram charges nothing for the bot itself: the platform is free for users and developers. Ordinary messages to users are free too, within Telegram's limits on sending speed. Writing and hosting the program may cost money. Telegram publishes no prices for that, so ask the developer or the service what their quote includes and whether the server is part of it.
Can one bot answer in several languages?
Yes. The name, description, about text and command list can be set for each language, and every user sees the version for the language set in their Telegram app. The program sends the reply written for that language, using the user's language code, which arrives with each message when known.
What happens to messages if the program stops?
They wait on Telegram's server until the program collects them, but not longer than 24 hours, and older ones are lost. So restart the program as soon as possible.