How to post to a Telegram channel with a bot
2 December 2026 · By the Yeetzo team · 5 min read
A Telegram channel is a one-way feed: you publish, subscribers read. You can type every message by hand, but a bot lets a script or a scheduler post for you. Setting one up takes a few minutes and no server.
What you need
- A Telegram account.
- A channel where you are the owner, or an admin who can add other admins.
- Something that can make a web request, if you want to test by hand.
Step 1: create the bot
- In Telegram, search for @BotFather. Check for the verification mark, since impostor accounts exist.
- Send
/newbot. - Give the bot a display name, then a username ending in
bot. - BotFather replies with a token, a long string with a colon in it.
The token is the bot's password. Anyone who has it can act as your bot. Keep it in a password manager or an environment variable, never in a public repository. If it leaks, ask BotFather to revoke it and issue a new one.
Step 2: add the bot to your channel
Open the channel, go to its administrators, and add your bot by username. Give it permission to post messages. Grant nothing it does not need: a posting bot does not have to add members or change channel details.
A bot that has not been made an administrator cannot post to a channel. This is the most common reason a first attempt fails.
Step 3: find the channel's address
A public channel has a username, and you can use it directly with the @ sign, for example @yourchannel.
A private channel has no username. You need its numeric chat id, which for channels begins with -100. One way to find it: after adding the bot, post any message in the channel, then open this address with your token:
https://api.telegram.org/bot<TOKEN>/getUpdatesLook for channel_post and read chat.id. If the result is empty, post another message and reload. If the bot already has a webhook set up somewhere, getUpdates will refuse; use the tool that owns the webhook instead.
Step 4: send a test message
curl -X POST "https://api.telegram.org/bot$TOKEN/sendMessage" -H "Content-Type: application/json" -d '{"chat_id": "@yourchannel", "text": "Hello from a bot"}'A successful reply contains "ok": true and the message that was created. A failure contains "ok": false with a description that is usually clear.
Photos, files and formatting
Use sendPhoto, sendVideo or sendDocument for media, with a caption for the text. Several pictures can go together as an album using sendMediaGroup.
Two limits matter every day: a text message holds up to 4096 characters, and a media caption up to 1024. If your announcement is long, send it as text, or put a short caption on the picture and the detail in a reply.
For bold, italic and links, set parse_mode to HTML or MarkdownV2. HTML is the more forgiving choice. MarkdownV2 requires you to escape many punctuation characters, including full stops and hyphens, and one missed character makes the whole request fail. With HTML you mainly need to escape <, > and &.
{
"chat_id": "@yourchannel",
"parse_mode": "HTML",
"text": "<b>Version 2 is out</b>\nRead the <a href='https://example.com/notes'>notes</a>."
}Common errors
| Message | Usual cause |
|---|---|
| chat not found | Misspelled @name, wrong id, or the bot has never been added |
| bot is not a member | Add it to the channel as an administrator |
| need administrator rights | The bot is there but may not post |
| Unauthorized | The token is wrong or has been revoked |
| message is too long | Over 4096, or over 1024 for a caption |
| Too Many Requests | Slow down and wait the number of seconds in retry_after |
Be considerate
Subscribers get a notification for each message unless they have muted you. A few habits keep them around:
- Group small updates into one message.
- Send quiet items silently with
disable_notification. - Schedule for hours when your readers are awake.
- Fix typos by editing rather than posting a correction.
Doing it without code
In Yeetzo, add a Telegram channel, paste the bot token and the @name or chat id, and you can write, preview and schedule from the browser. The composer switches the counter to 1024 when media is attached. A thread of several parts is posted as a first message with replies, and Analytics tracks your member count from the day you connect.
If you would rather keep using code, the REST API and command line post to the same channel, so a release script can announce a new version without ever handling the bot token itself.
Checklist
- Bot created and token stored safely.
- Bot added as an administrator with permission to post.
- Correct @name or
-100id. - Test message received.
- Formatting mode chosen and special characters escaped.
Questions people ask
Can a bot schedule messages itself?
Telegram's Bot API sends a message when you call it. It has no field for a future time, so a bot that should post at 09:00 needs something else to make the call at 09:00, such as a scheduler, a cron job or a tool like Yeetzo, whose timer checks every minute. Telegram's own apps do have a schedule option for people posting by hand.
How do I turn off link previews?
Add link preview options to the request and set is_disabled to true. Previews help when you want a card for your article. They get in the way when you link to several things in one message.
Can the bot edit or delete what it posted?
Yes, with editMessageText and deleteMessage, using the message id returned when it was sent. Editing is kinder than deleting because subscribers who already read the message see the corrected text.
Can it pin an announcement?
It can call pinChatMessage if you gave it the admin right to pin messages. Pin sparingly: a channel with five pinned items has none.
Do I need a separate bot for every channel?
No. One bot can be an administrator in many channels, and you choose the destination with each call. Separate bots make sense when different people manage different channels, since you can then revoke one token without affecting the rest.
How should I look after the token?
Store it in a secret manager or environment variable. Do not paste it into support chats, screenshots or examples. When someone leaves your team, replace it with BotFather's token revocation command so the old one stops working.