How to Use Telegram’s Search Engine (Every Tab and Filter)
29/10/2026Where Are Telegram Photos Stored? Exact Folders for Every App
29/10/2026
Build kit Skill level 1 to 3 · about 10 minutes to a live bot
How do you create a Telegram bot?
Open @BotFather in Telegram, send /newbot, type a display name, then a username that ends in bot. BotFather answers with a token. That token is the key to your bot: put it in a short script or a bot builder, keep it secret, and your bot starts answering messages.
- FreeNo approval, no fee
- 5 to 32 charactersUsername ends in bot
- 20 bots per account40 with Premium
- Bot API 10.3Current since 24 Aug 2026
Part 0: test your username before BotFather does
- 5 to 32 characters 17
- Only Latin letters, digits and _
- Ends in “bot” (any case)
- Permanent: you can never rename it
Looks valid. BotFather still checks that nobody has taken it.
t.me/kitchen_timer_bot
What do you need before you start?
Six parts, all free except the place your bot runs. Tap a part to snap it off the frame and read what it is for.
A Telegram account
Every bot belongs to a normal Telegram account, its owner. Use the account you will keep: only the owner can open the bot in BotFather, see its token or transfer it. Any official app works.
A team project? You can later transfer the bot in BotFather to another person who has messaged it at least once. The transfer is permanent.
How do you create a bot with BotFather, step by step?
The same six steps work in every Telegram app. Open a panel to unfold it.
Find the real @BotFather
Search for @BotFather and open the result with the blue verified check. The username is exactly BotFather; copies such as BotFather_official are fakes that try to collect tokens. Tap Start.
Start a new bot
Type /newbot and send it, or tap it in the command menu. BotFather asks you for a name first. Prefer buttons to commands? The BotFather Mini App, added in July 2025, creates and edits bots too.
Type the display name
This is what people see in chats and on the profile, for example Kitchen Timer. Spaces and emoji are fine, up to 64 characters, and you can change it any time with /setname.
Choose the permanent username
5 to 32 characters, Latin letters, digits and underscores, ending in bot: kitchen_timer_bot or KitchenTimerBot. If it is taken, BotFather simply asks again. Choose carefully: a bot’s username cannot be changed after creation.
Save the token somewhere safe
BotFather confirms the bot, gives its link (t.me/kitchen_timer_bot) and the HTTP API token. Copy the token into a password manager or your project’s environment variables, never into a public file.
Open your bot and press Start
Tap the link and press Start. Nothing answers yet, and that is normal: a fresh bot is an empty shell. It replies only once code (section 06) or a builder (section 05) is running with its token.
What is the bot token, and how do you keep it safe?
The token is a username and password in one string. Whoever has it can act as your bot. This is the sample token from Telegram’s own documentation:
With a leaked token, a stranger can
- Read every new message people send to your bot
- Reply, broadcast and post in your bot’s name
- Change its name, description and command list through the API
- Switch on a webhook and steal all updates from your code
They still cannot
- Log in to your personal Telegram account
- See your private chats or contacts
- Delete the bot or transfer it: that needs BotFather in your account
- Use the old token after you revoke it
Token leaked or lost? Revoke it:
- @BotFather
- /mybots
- Your bot
- API Token
- Revoke current token
BotFather sends a new token at once and the old one stops working. Paste the new one into your code or builder. Golden rules: keep the token in an environment variable, add your .env file to .gitignore, and never paste it into a site you do not trust.
How do you set the name, picture, description and commands?
Open /mybots in BotFather, pick your bot, then Edit Bot (or use the Mini App). Point at a label to see where it shows up.
- From codeThe same fields can be set with setMyName, setMyDescription, setMyShortDescription and setMyCommands, even per language.
Should you write code or use a no-code builder?
Switch on what is true for you. The needle shows which build fits.
Either works. Start with the short script in section 06; you can still move to a builder later.
Managed bots. Since Bot API 9.6 (March 2026) a builder can be a manager bot: you open its link or button, pick a name and a username, and Telegram creates the bot in your account without you copying a token anywhere. You stay the owner and can still edit it in BotFather; the manager bot gets the token and runs it.
Writing code? Telegram lists community libraries (not maintained by Telegram) at core.telegram.org/bots/samples:
aiogrampython-telegram-botpyTelegramBotAPITelegrinder
What does a minimal working bot look like?
No library, no framework: one file that answers /start and repeats any text back. It uses long polling, so it runs on a laptop with no domain or HTTPS.
import json, os, time, urllib.request, urllib.error
TOKEN = os.environ["BOT_TOKEN"]
API = "https://api.telegram.org/bot" + TOKEN + "/"
def call(method, **params):
body = json.dumps(params).encode()
req = urllib.request.Request(API + method, body, {"Content-Type": "application/json"})
with urllib.request.urlopen(req, timeout=60) as r:
return json.load(r)["result"]
offset = 0
while True:
try:
for update in call("getUpdates", offset=offset, timeout=50):
offset = update["update_id"] + 1
msg = update.get("message")
if msg and "text" in msg:
text = msg["text"]
reply = "Hi! Send me any text and I will repeat it." if text == "/start" else text
call("sendMessage", chat_id=msg["chat"]["id"], text=reply)
except urllib.error.HTTPError as e:
print("Telegram said", e.code, e.read().decode())
time.sleep(5)
except OSError as e:
print("Network problem:", e)
time.sleep(5)
const API = "https://api.telegram.org/bot" + process.env.BOT_TOKEN + "/";
async function call(method, params) {
const res = await fetch(API + method, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(params),
});
const data = await res.json();
if (!data.ok) throw new Error(data.error_code + " " + data.description);
return data.result;
}
let offset = 0;
while (true) {
try {
const updates = await call("getUpdates", { offset, timeout: 50 });
for (const update of updates) {
offset = update.update_id + 1;
const msg = update.message;
if (!msg?.text) continue;
const reply = msg.text === "/start" ? "Hi! Send me any text and I will repeat it." : msg.text;
await call("sendMessage", { chat_id: msg.chat.id, text: reply });
}
} catch (err) {
console.error(err.message);
await new Promise((r) => setTimeout(r, 5000));
}
}BOT_TOKEN="123456789:your-token" python3 bot.py- Token from the environment. The token never sits in the file, so you can share or commit the code safely.
- Every method is one HTTPS request to api.telegram.org/botTOKEN/METHOD with a JSON body. That is the whole Bot API.
- Long polling. getUpdates with timeout 50 waits up to 50 seconds for new messages instead of hammering the server.
- Confirm what you read. Asking with offset = last update_id + 1 tells Telegram those updates are done; skip it and you get them again.
- Answer. sendMessage to the same chat ID. Text can be up to 4,096 characters.
- Survive errors. Print Telegram’s error, wait 5 seconds, try again, so a network blip does not kill the bot.
How we tested it: on 27 October 2026 we ran both files (Python 3.13 and Node.js 22) against a local stand-in server that answers getUpdates and sendMessage in the documented format. /start got the greeting, plain text was echoed, a sticker was ignored, and a wrong token produced a 401 Unauthorized error that the script printed and survived. Our test machine cannot reach api.telegram.org, so the first run with your real token is the true test. Python needs version 3.8 or newer; the JavaScript file needs Node.js 18 or newer and the .mjs extension. On Windows PowerShell set the token first with $env:BOT_TOKEN="...".
Long polling or webhook: how does your bot get messages?
Telegram keeps each new update for your bot for up to 24 hours. Your code collects it in one of two ways, never both at once.
Works anywhere
Your laptop behind a home router is enough. No domain, no HTTPS certificate, no open port. Best for learning and small bots.
Run only one copy
Two running copies fight over the same updates and one gets error 409 “terminated by other getUpdates request”.
Must stay running
When the script stops, the bot goes quiet. Updates wait on Telegram for up to 24 hours, then they are gone.
Where can the bot live?
- Your own computerPerfect for building and testing. The bot sleeps when the computer sleeps.
- A small always-on serverA VPS or home server runs polling or a webhook around the clock. You handle updates and restarts.
- Serverless functionsWebhook only: Telegram calls your function per update. Cheap for quiet bots; watch cold starts and time limits.
- A builder’s serversZero setup. The builder holds your token and sees the messages.
How do you test your bot, including in a group?
Run these six checks in order and tick them off. The grey lamps are tests where silence is the correct result.
0 of 6 checks passed
Tick each check as you run it.
Bot should answerSilence is correctSetting to change
Why is my bot not working?
These are the real error texts the Bot API returns. Click the line you see in your log.
401Unauthorized
Cause: the token is wrong, was revoked, or the URL lacks the word bot before it (it must be /bot123456789:AA…/getMe).
Fix: copy the current token from BotFather (/mybots, API Token) and check for stray spaces or quotes.
409Conflict: terminated by other getUpdates request; make sure that only one bot instance is running
Cause: two copies of your bot are polling at once, often an old terminal window, a second server, or a hosting platform that started a new copy before stopping the old one.
Fix: stop every copy except one. If you cannot find it, revoke the token so the stray copy is locked out.
409Conflict: can’t use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first
Cause: a webhook is still set (perhaps by a builder or an earlier test), and polling and webhooks are mutually exclusive.
Fix: call deleteWebhook once, then start polling again.
403Forbidden: bot can’t initiate conversation with a user
Cause: bots cannot message someone first. The person has never pressed Start.
Fix: share t.me/yourbot and let them start the chat; only then can the bot write to them.
403Forbidden: bot was blocked by the user
Cause: the person blocked or stopped the bot.
Fix: nothing to repair. Mark them inactive and skip them in future broadcasts.
400Bad Request: chat not found
Cause: a wrong chat_id, or the bot is not in that chat. Group IDs are negative, and supergroup and channel IDs start with -100.
Fix: take the chat ID from an incoming update instead of typing it, and make sure the bot was added to the group or channel.
429Too Many Requests: retry after 7
Cause: you sent faster than the limits in section 10.
Fix: wait the number of seconds in parameters.retry_after, then slow down with a queue.
OKNo error at all, but no reply in the group
Cause: privacy mode. The bot never received the message.
Fix: use a /command@yourbot, reply to the bot, or change privacy as in check 6 above.
What limits should you plan for?
From Telegram’s Bots FAQ, the Bot API reference and the app configuration. Speeds are drawn on a log scale.
Sending speed
What can you add once the basic bot works?
One pointer each; every box links to the official guide.
Where will your bot’s first users come from?
A bot cannot invite anyone; every user arrives by tapping your link and pressing Start. Most bots grow from a channel or group that posts that link where the right people already read. If your channel is brand new, a starting audience helps the first posts get seen. Members and views do not press Start for you: the bot still has to be useful.
- Channel post
- t.me/yourbot?start=channel
- User presses Start
What else do people ask about creating a Telegram bot?
Is it free to create a Telegram bot?
Yes. BotFather and the Bot API cost nothing and there is no approval step. You only pay for a server if you need one, and for paid broadcasts if you send more than about 30 messages per second.
How many bots can one Telegram account create?
Telegram’s client configuration lists 20 bots for a normal account and 40 with Telegram Premium. When you hit the limit, delete an old bot with /deletebot or get Premium.
Can I change my bot’s username later?
No. The username is fixed when you create the bot. You can change the display name, picture, about text and description at any time. For a new username, create a new bot; deleting the old one with /deletebot frees its username.
Can I create a Telegram bot without coding?
Yes. No-code builders run the bot for you, and since March 2026 managed bots let a builder bot create the bot in your account with a few taps. The trade-off is that the builder holds the token and sees your users’ messages.
What should I do if my bot token leaks?
Revoke it at once: in @BotFather open /mybots, choose the bot, tap API Token and then Revoke current token. The old token stops working and you get a new one to paste into your code.
Why does my bot ignore messages in a group?
Privacy mode is on by default, so the bot only receives commands addressed to it, replies to its messages and service messages. Make it an admin, or disable privacy with /setprivacy and then remove and re-add the bot.
Can my bot send the first message to someone?
No. A user has to open the bot and press Start first; otherwise the API answers with 403 “bot can’t initiate conversation with a user”.
Which programming language is best for a Telegram bot?
Any language that can send HTTPS requests works. Python and JavaScript have the most community libraries, such as aiogram, python-telegram-bot and grammY, and the most examples to learn from.
Which guides go with building a bot?
How we checked this guide. On 27 October 2026 we read Telegram’s Bot Features page (BotFather, usernames, privacy mode, commands), the Bots FAQ (send limits, webhooks, file sizes), the Bot API reference and its changelog (version 10.3), the managed bots and client configuration docs (bot limits), the library list, and Telegram’s announcements of the BotFather Mini App (July 2025), managed bots (March 2026) and guest bots (May 2026). We ran both code samples against a local stand-in for the Bot API. Written by the AddTelegramMember team, a Telegram growth service since 2019.