How to create a Telegram bot with BotFather and get your token
Register a brand new Telegram bot through BotFather and copy the API token you need for every other integration.
Every Telegram automation starts with one thing: a bot token. The token is a long string that lets your code talk to Telegram on behalf of a bot account. You get it from BotFather, the official bot that creates other bots. This guide walks through the whole flow so you finish with a working token you can paste into any script or service.
What you need
- A Telegram account on phone or desktop
- Two minutes to chat with BotFather
- A safe place to store the token (a password manager or .env file)
Step 1: Open BotFather
In the Telegram search bar, type @BotFather and open the account with the blue verified check mark. There are copycats, so the verified badge matters. Press Start to see the command list.
Step 2: Run /newbot
Send the command /newbot. BotFather asks for a display name (anything you like, e.g. Order Helper) and then a username. The username must be unique across all of Telegram and must end in bot, for example order_helper_bot.
Step 3: Copy and store the token
BotFather replies with the token. It looks like a number, a colon, then a long random string. Copy it right away. Anyone who has this token can fully control your bot, so treat it like a password.
TELEGRAM_BOT_TOKEN="7843201955:AAH9k...your-real-token-here"/revoke in BotFather and pick the bot. It instantly invalidates the old token and gives you a new one, so any leaked copy stops working.Step 4: Verify the token works
Telegram exposes a simple HTTP API. The getMe endpoint returns the bot's own profile, which is the quickest way to confirm the token is valid.
Result
You now have a live bot and a verified token. The "ok":true response proves the credential is good. Keep that token handy: every other guide in this series starts from it.
Watch related tutorials
1:42:18
28:14
41:09
9:47
8:23
52:31