In this article
Every bot mentioned anywhere in this curriculum — the one that posts your feed, the one that issues subscription links, the one moderating your group — was created in a conversation with a bot called BotFather, and is controlled from there afterwards.
The whole subject reduces to one sentence. A bot has no phone and no password; it has a string, and whoever holds the string is the bot. Everything else on this page is a consequence of that.
What you will be able to do after this step
- check_circle Create a bot and choose the one thing about it you cannot change.
- check_circle Treat the token as the credential it is, and know how to invalidate it.
- check_circle Answer honestly when members ask whether the bot reads their messages.
- check_circle Recognise what a bot is structurally incapable of doing.
smart_toy Creating one, and the decision that is permanent
You open a conversation with BotFather, ask for a new bot, give it a display name, and give it a username. In return you get a token. That is the whole ceremony, and it takes about ninety seconds.
One of those choices does not come back. The display name can be changed whenever you like; the username effectively cannot. It has to be globally unique, it has to end in "bot", and it is what every link, every poster and every mention will point at forever after. Choose it the way you would choose a domain: short, spellable aloud, and not tied to a campaign or a year.
Two other pieces of text are worth writing properly on the day you create it, because they are the only things a stranger reads before deciding to press Start: the short description that appears on the bot's empty screen, and the "about" line that appears on its profile. Say what it does and what the first message should contain. This is the same principle as Step 078's free posts — it is the sales material, and it is usually left blank.
key The token is the bot
The token is a single string containing an identifier and a secret. Anything holding it can send what your bot sends, receive what your bot receives, and act with whatever rights your bot has been granted in any room. There is no second factor, no device binding and no login alert.
Which means the handling rules are the ones you would apply to a password with no recovery. It never goes into a repository, a mobile application, a page's code, a screenshot, or a message to a colleague. The most common way tokens escape is not an attack; it is a working file committed to somewhere public, and automated scanning of public code for exactly these strings is a routine activity.
If one escapes, revoke it in BotFather. That invalidates the old string immediately and issues a new one, and whoever copied yours now holds something useless. Note what revoking does not do: it does not remove the bot from your channels or reduce its rights there. If the problem is the bot itself rather than a leaked credential — a service you no longer trust, a tool you stopped using — the action is to remove its administrator rights in each room, which is the control described in Step 085.
Finally, the question of who owns it. The account that created the bot controls it in BotFather. If that is a colleague, a contractor or an old personal account of yours, then the bot's future belongs to that account. Transfer it deliberately while everyone is still on speaking terms rather than discovering the problem when somebody leaves.
You add a moderation bot to your group. A member asks whether it can read the conversation. What is the honest answer?
By default a bot in a group is restricted: it receives commands directed at it, replies to its own messages, and mentions of its username, and ordinary conversation between members is not delivered to it. That restriction can be switched off by whoever runs the bot, which is necessary for anything that filters spam or watches for keywords. And the part people miss: promoting the bot to administrator lifts the restriction anyway. So the honest answer to a member is "it depends how it is configured, and yes if it is an administrator" — and if you are going to tell your group that a bot cannot read their messages, you had better know both of those settings for that specific bot.
Your bot's token has been committed to a public code repository. What do you do first?
Removing the commit does nothing, because copies were made the moment it was published and the string still works. Changing the username is not possible and would not help if it were. Revoking is the only action that addresses the actual problem: it invalidates the secret, so every copy anywhere becomes worthless at once, and you receive a fresh one to put into your own deployment. Do that first, tidy the repository second, and then look at what the bot has been doing since the commit went up — anything with posting rights in a channel should have its recent activity checked.
A bot you have never used sends you a message out of nowhere. What is going on?
A bot cannot open a conversation with somebody who has never written to it. That is a structural property of the platform rather than a policy, and it is one of the more useful security facts available to an ordinary user: unsolicited contact never comes from a bot behaving normally. So when a "support bot" or a "verification bot" appears unprompted, the two possibilities are that you interacted with it at some point in the past, or that it is a person with a bot-shaped name and photograph. The second is far more common, and the message that follows will ask you for a code, a phrase or a payment.
admin_panel_settings Rights, and the one never to give
A bot added to a channel or group holds exactly the administrator rights somebody granted it and nothing more. The discipline is the ordinary one: grant the narrowest set that lets it do its job, and review the list occasionally, because rooms accumulate bots from projects that ended.
The right never to grant is the ability to add administrators. A bot with that can promote anything, including something that can remove you. Everything else is recoverable; that one hands over the room. The next most consequential is deletion, which lets a misbehaving automation remove your archive faster than you can stop it.
Worth knowing in the other direction: a bot cannot join anything by itself. Somebody with authority has to add it. That makes the administrator list a complete inventory of what is able to act in your room, which is why Step 085 treats reading that list as the security control it is.
touch_app Try it now — five minutes
Four steps, and the first two are worth doing even if you never intend to run a bot.
- Create a throwaway bot Ninety seconds in BotFather. Seeing the token appear, once, teaches the rest of this page better than reading about it.
- Revoke its token and watch a new one arrive Now you know where the emergency control is, which is the point of the exercise.
- Open every room you administer and read the bot list Anything you cannot account for, remove. Anything with more rights than it needs, reduce.
- Write the description and about text for a bot you already run Two short pieces of text that strangers read before pressing Start, and which are almost always empty.
shield What a bot cannot do
Knowing the boundaries is more useful than knowing the features, both for building and for not being tricked.
It cannot message you first. Covered in the quiz and worth repeating, because it converts a whole family of scams into something you can identify in a second.
It cannot join a room on its own, or see a channel it has not been added to, or read a group it is not in.
It cannot see your phone number, your other chats or your contacts. It knows the account it is talking to and whatever you send it. Some bots ask you to share a contact or a location, and those are explicit prompts you answer — not something taken quietly.
It cannot act outside the rights it was given. A bot with permission to post cannot delete, ban or read the member list, and no amount of code changes that from its side.
And one thing it can do that people forget: anybody who starts a conversation with a bot is identified to whoever runs it. Not your number, but your account, your display name and your username. For an ordinary tool that is unremarkable. For a bot claiming to offer something anonymous, it is worth thinking about, because the operator of that bot is a stranger with a server.
help Common questions at this stage
Can I change my bot's username later?
Treat it as permanent. The display name, the photograph, the description and the commands can all be changed freely; the username is the address everything points at. If you genuinely must move, the practical route is creating a new bot and migrating, which means every existing link, printed code and saved conversation breaks. That is why the ninety seconds spent choosing it is the most consequential part of the creation process.
How many bots can one account create?
Enough that the constraint you hit first is your own ability to remember what they were for. The habit worth forming is deleting the experiments: a bot you made to try something, left in a channel and forgot is a credential you are no longer watching. BotFather can delete a bot outright, and doing so for the abandoned ones is a five-minute piece of hygiene that removes real exposure.
Where should the token actually live?
In whatever your hosting provides for secrets — an environment variable, a secrets store — and nowhere else, particularly not in the file you are editing. The practical test is whether the token would survive being copied into a public place by accident: if the answer depends on you remembering not to, the arrangement is wrong. And if a third-party service needs it, understand that you have given that company the ability to act as your bot for as long as they hold it.
Does a bot need to be an administrator to work in a group?
Only if it needs to act on the room. A bot that answers questions when asked works perfectly well as an ordinary member. A bot that deletes spam, restricts people or pins messages needs the specific rights for those actions — and as the quiz notes, promoting it also removes the message restriction, so a bot made administrator for one small job now receives everything said in the room. That trade should be made knowingly rather than because promotion seemed like the way to get something working.
Can somebody find out what my bot does from the outside?
They can see everything you published about it — name, photograph, description, registered commands — and everything it says to them. They cannot see your code or your data. What they can do is try every command and see what happens, which is worth doing yourself from an account with no privileges, because that is exactly what the first curious stranger will do and it is how administrative commands turn out to be answering anybody.
What happens to a bot if I stop paying for its server?
It stays in every room it was added to and stops responding. Nothing announces this; buttons on old posts do nothing (Step 081), commands fall silent, and any process you built around it quietly stops. If you are winding something down, remove the bot from the rooms as part of the shutdown, and if you inherit a channel with a silent bot on the administrator list, the fact that it does nothing today is not a reason to leave the credential in place.
At a glance
- 1Create with BotFather
Choose the username carefully; it cannot be changed later.
- 2The token is the bot
Anyone with it controls the bot; revoke it if it leaks.
- 3Honest about reading
By default a bot sees only messages meant for it; admin bots see all.
Updated