Telegram 403: Forbidden: bot is not a member of the channel chat — how to fix it
Telegram knows the channel, but your bot is not in it, so every send, edit or delete there fails with a 403. Usually the bot was never added (a public channel is found by its @username even so), it left with leaveChat, it was removed and then unbanned, or the token belongs to a different bot. Add the bot to the channel as an administrator that can post messages. The same error exists for supergroups and groups.
By Livops team, the people who build and run LivopsUpdated
The full error, as the Telegram Bot API returns it with error code 403[2]:
Forbidden: bot is not a member of the channel chat
The same check has two siblings, for a supergroup and for a basic group[2]:
Forbidden: bot is not a member of the supergroup chat
Forbidden: bot is not a member of the group chat
Each library wraps it in its own words:
| Library | What you see |
|---|---|
| aiogram 3 | TelegramForbiddenError: Telegram server says - Forbidden: bot is not a member of the channel chat[4][5] |
| python-telegram-bot | telegram.error.Forbidden: Forbidden: bot is not a member of the channel chat[6][7] |
| grammY | GrammyError: Call to 'sendMessage' failed! (403: Forbidden: bot is not a member of the channel chat)[8] |
| Telegraf | TelegramError: 403: Forbidden: bot is not a member of the channel chat[9] |
python-telegram-bot strips an Error: or Bad Request: prefix from a description, not Forbidden: , so this message keeps it[6]. This page explains when the Bot API server gives this error, how it differs from chat not found and bot was kicked, the causes from the most common, and how to check the fix.
What does the error mean?
Before a method touches a chat, the Bot API server checks the bot’s own status in it. For a channel or a supergroup, the server’s rules are[2]:
- If the bot is banned there, the answer is
Forbidden: bot was kicked from the channel chat(orsupergroup chat). - If the bot is not a member — its status is
left, or it is restricted and not a member — and the method needs more access than the chat allows a stranger, the answer isForbidden: bot is not a member of the channel chat(orsupergroup chat). - Public or private decides what “more access” is. A channel or supergroup with a username is public: reading it, such as
getChat, works without membership, and only methods that send, edit or delete need the bot inside. A private one needs membership even to be read.
For a basic group the server answers Forbidden: bot is not a member of the group chat when the group is still active and the bot has left it[2].
So the server found the chat; the bot just is not in it. The Bot API’s left status is a chat member who is not currently a member but may join, and kicked is one who was banned and cannot return[1].
How is it different from chat not found and kicked?
| Description | Code | What happened | What to do |
|---|---|---|---|
Bad Request: chat not found |
400 | The server does not know the chat: a wrong id, or a private chat this bot was never in | Fix the id or the token; see chat not found |
Forbidden: bot is not a member of the channel chat |
403 | The chat is known, the bot’s status there is left |
Add the bot to the chat |
Forbidden: bot was kicked from the channel chat |
403 | The bot is banned in the chat | Ask an admin to add it back; see bot was kicked |
Bad Request: need administrator rights in the channel chat |
400 | The bot is in the channel but may not post | Make it an administrator that can post; see not enough rights |
The last row comes from TDLib, under the Bot API server: in a channel, a chat member without the right to post gets Need administrator rights in the channel chat[3], which the server passes on as a 400 with Bad Request: in front[2]. Telegram says the numeric error_code may change in the future[1], so tell these apart by the description your library gives you, not by the number alone.
Causes, most common first
1. The bot was never added to the channel
The most common case, and the one that looks strangest: you send to @mychannel, Telegram clearly finds it, and still refuses. A public channel can be addressed by its @username[1], and the server resolves it for any bot; only the send needs the bot to be inside[2]. A private channel the bot was never in gives chat not found instead.
Fix: an administrator of the channel adds the bot as an administrator, with the right to post messages. can_post_messages is the administrator right to post in a channel, and it exists for channels only[1]. A bot cannot add itself: the Bot API has no method for joining a chat[1].
2. The bot left the chat
leaveChat makes a bot leave a group, supergroup or channel[1]. A cleanup script, an admin command in your own bot, or a test that called it once leaves the bot’s status at left, and sends there fail with this 403[2]. Add the bot again.
3. It was removed, then unbanned
When a bot is removed and banned, sends give bot was kicked[2]. If an admin then unbans it, it is not back in the chat: an unbanned user does not return automatically, and unbanChatMember by default guarantees that the user is not a member afterwards[1]. The error turns from kicked into not a member. Add the bot again.
4. A different bot’s token
Membership is per bot. The channel has @shop_bot as an administrator, and the code sends with the token of @shop_test_bot: the channel is public, so the test bot resolves it, and it is not a member. This is common when staging and production use different bots. Check which bot the token belongs to:
curl -s "https://api.telegram.org/bot$BOT_TOKEN/getMe"
getMe returns the bot’s username and id; that bot must be the one in the channel’s administrator list.
5. A supergroup or group the bot is not in
The same causes give the siblings: bot is not a member of the supergroup chat for a supergroup, bot is not a member of the group chat for a basic group the bot has left[2]. In a group or supergroup an ordinary member may send if the group’s default permissions allow it[1], so the bot does not have to be an administrator there; adding it as a member is enough to clear this error.
How to check the fix
Find the bot’s id with getMe above, then ask Telegram for the bot’s own status in the channel:
curl -s "https://api.telegram.org/bot$BOT_TOKEN/getChatMember?chat_id=@mychannel&user_id=$BOT_ID"
getChatMember returns a ChatMember[1]. You want "status":"administrator" with "can_post_messages":true. Then send one message with the exact chat id and token the app uses:
curl -s "https://api.telegram.org/bot$BOT_TOKEN/sendMessage" \
--data-urlencode "chat_id=@mychannel" \
--data-urlencode "text=test"
"ok":true means the bot is in and may post. For a private channel, use its numeric id, which starts with -100, in place of @mychannel.
Learn about it before the next send. Telegram sends the bot a my_chat_member update when the bot’s own status in a chat changes[1]. Handle it to record when the bot is added to a channel, and when it becomes left or kicked, so a broadcast skips those chats instead of meeting the 403. A full example is in bot was kicked from the group chat.
On Livops
Livops does not add your bot to chats or retry its sends; the fixes above are in Telegram and in your code. What to check on the Livops side:
- The token and the channel are variables. Put
BOT_TOKENand the target, such asCHAT_ID=@mychannelor-1001234567890, under Variables, without quotes. New values take effect on the next deploy; restart the service to apply them now. Mark the token as a secret, and its value is never shown again, only its name. - Staging copies the variables. A new environment such as
staginggets copies of production’s services and variables. Give it its own test bot’s token so the two do not share one bot, and then add the test bot to a test channel too: with production’sCHAT_ID, the test bot meets exactly cause 4. See Environments. - Logs. Log the chat id and the bot’s username next to each failed send; the project’s Logs page and
livops logs <service> -fshow them. The assistant sees variable names, never their values, so it cannot tell you which bot a token belongs to;getMecan. - Scheduled posts as a cron job. A
cronservice runs a command on a schedule, for example a script that posts to the channel every morning. It should only send: if it also calledgetUpdateswhile the bot polls, Telegram would answer with aConflicterror. See Cron and workers.
A bot, worker or cron job costs 19 credits a month (19,000 so’m); see Pricing.
Questions
How do I add my bot to a channel?
An administrator of the channel adds it: in the channel's settings, add the bot as an administrator and leave the right to post messages switched on. A bot cannot join by itself, because the Bot API has no method for joining a chat.
Why can my bot read a public channel with getChat but not post to it?
For a public channel or supergroup, the Bot API server asks for membership only when a method writes, edits or deletes. Reading its info by @username works without it. Sending needs the bot to be in the channel, and in a channel only an administrator with the right to post may send.
What is the difference between not a member and bot was kicked?
Kicked means the bot is banned in that chat: an administrator removed it and it cannot come back until someone unbans or re-adds it. Not a member means its status is left: it was never added, it left with leaveChat, or it was unbanned but not added back. Both are 403s.
How is it different from chat not found?
Chat not found is a 400: the server does not know the chat at all, for example a private channel the bot was never in, or a wrong id. Not a member is a 403: the server found the chat and the bot is not in it, which happens most with public channels found by @username.
The bot is a member but sending still fails. Why?
Then the error is a different one. In a channel, a bot that is in it but cannot post gets Bad Request: need administrator rights in the channel chat. Make it an administrator with the right to post messages.
Should my code retry the send?
No. Nothing changes until someone adds the bot to the chat, so a retry gets the same 403. Log it, stop sending to that chat, and resume when the bot gets a my_chat_member update saying it was added.
Sources
- Telegram Bot API — Making requests, sendMessage, getChat, getChatMember, leaveChat, unbanChatMember, ChatMember, ChatAdministratorRights, Update (core.telegram.org). Checked .
- Telegram Bot API server source — telegram-bot-api/Client.cpp (raw.githubusercontent.com). Checked .
- TDLib source — td/telegram/DialogManager.cpp (raw.githubusercontent.com). Checked .
- aiogram source — aiogram/exceptions.py (raw.githubusercontent.com). Checked .
- aiogram source — aiogram/client/session/base.py (raw.githubusercontent.com). Checked .
- python-telegram-bot source — telegram/error.py (raw.githubusercontent.com). Checked .
- python-telegram-bot source — telegram/request/_baserequest.py (raw.githubusercontent.com). Checked .
- grammY source — src/core/error.ts (raw.githubusercontent.com). Checked .
- Telegraf source — src/core/network/error.ts (raw.githubusercontent.com). Checked .
Put your project online today
Connect GitHub or drop a folder. No card is asked for.
Deploy your botRelated
- Telegram 400: Bad Request: chat not found — how to fix itThe bot asked Telegram for a chat it does not know. Either the chat_id is wrong (a typo, a channel id without its -100 prefix, a user's @username, an id cut to 32 bits), or it is right but this bot has never been in that chat: the user never pressed Start, the bot was never added to the group or channel, or the token belongs to a different bot.
- Telegram 403: Forbidden: bot was kicked from the group chat — how to handle itSomeone removed the bot from that group, supergroup or channel, and Telegram refuses every message it sends there. Nothing is broken and a retry will not help: mark the chat inactive in your database, skip it in broadcasts, and mark it active again when the bot is added back. The my_chat_member update tells you the moment it happens.
- Telegram 400: Bad Request: not enough rights to send text messages to the chat — how to fix itBad Request: not enough rights to send text messages to the chat means the bot is in the group, but its permissions there do not allow this kind of message: the group's default permissions turn sending off for members, or the bot itself was restricted. Make the bot an administrator, or turn the permission back on; check with getChatMember for the bot's own id. In a channel the bot needs to be an administrator that can post.
- Telegram 403: Forbidden: bot was blocked by the user — how to handle itThe user blocked the bot, and Telegram refuses every message the bot sends them. Nothing is broken and a retry will not help: catch the 403, mark that user as inactive in your database, skip them in broadcasts, and mark them active again when they write to the bot.
- Telegram 400: Bad Request: group chat was upgraded to a supergroup chat — how to fix itThe group your bot writes to was upgraded to a supergroup, and the supergroup has a new chat id: the old one no longer takes messages. The error carries the new id in parameters.migrate_to_chat_id. Save it in place of the old id and send again, and handle the migrate_to_chat_id service message so the id is updated before the next send fails.
- Telegram bot hosting in 2026: the options comparedA Telegram bot needs a process that never stops, or a public HTTPS address for a webhook. On Livops it runs from a GitHub push for 19 credits a month (19,000 so'm). Here is how a VPS, Railway, Render, Fly.io and Vercel compare.
- aiogram bot hosting: how to deploy an aiogram 3 botAn aiogram 3 bot needs one process that never stops, the token in an environment variable, state kept outside memory and a clean exit on SIGTERM. On Livops you push a repository with bot.py and requirements.txt, and it runs for 19 credits a month (19,000 so'm), polling or webhook.
- python-telegram-bot hosting: deploying a v22 botA python-telegram-bot bot runs as one Application: run_polling() for polling, run_webhook() with the webhooks extra for a webhook. Both stop cleanly on SIGTERM. On Livops it runs from a push with bot.py and requirements.txt for 19 credits a month (19,000 so'm).
- grammY bot deploy: polling, webhooks and hostingDeploy a grammY bot as one always-on Node.js process: bot.start() for polling, or webhookCallback() behind an HTTP server, with bot.stop() on SIGTERM. On Livops a repository with grammy in package.json runs as a bot from every push, for 19 credits a month (19,000 so'm).
- Telegraf bot hosting: deploying a Telegraf 4 bot on Node.jsA Telegraf bot is one Node.js process: bot.launch() for polling, or bot.webhookCallback() behind an HTTP server for a webhook, with bot.stop() on SIGTERM. On Livops a repository with telegraf in package.json is run as a bot from every push, for 19 credits a month (19,000 so'm).