# Telegram 403: Forbidden: bot was kicked from the group chat — how to handle it

> Someone 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.

Source: https://livops.dev/en/guides/error-telegram-bot-was-kicked-from-the-group-chat

By Livops team, the people who build and run Livops. Updated 3 December 2026.

The full error, as the Telegram Bot API returns it with error code 403[2]:

```text
Forbidden: bot was kicked from the group chat
```

The same server has two siblings for the other chat types, also 403[2]:

```text
Forbidden: bot was kicked from the supergroup chat
Forbidden: bot was kicked from the channel chat
```

Your library wraps it in its own words:

| Library | What you see |
| --- | --- |
| aiogram 3 | `TelegramForbiddenError: Telegram server says - Forbidden: bot was kicked from the group chat`[4][5] |
| python-telegram-bot | `telegram.error.Forbidden: Forbidden: bot was kicked from the group chat`[8][9] |

This page explains what the error means, how it differs from the errors that look like it, how to learn about the removal before you send anything, and how a broadcast loop should catch it per chat and keep going. The code is aiogram 3, with the python-telegram-bot equivalent at the end.

## What does the error mean?

The bot is no longer in that chat. Before it sends anything, the Bot API server checks the bot's own status in the target chat. In a basic group where the bot was kicked, it answers `bot was kicked from the group chat`; in a supergroup or channel where the bot's status is banned, it answers `bot was kicked from the supergroup chat` or `bot was kicked from the channel chat`[2].

So this is not a bug in your code, not a token problem and not a rate limit. An administrator removed the bot. Every later message to that chat gets the same answer until somebody adds the bot back.

The relatives, all 403 and all meaning "stop sending here"[2]:

| Description | What happened |
| --- | --- |
| `Forbidden: bot was kicked from the group chat` | Removed from a basic group |
| `Forbidden: bot was kicked from the supergroup chat` | Removed and banned in a supergroup |
| `Forbidden: bot was kicked from the channel chat` | Removed and banned in a channel |
| `Forbidden: bot is not a member of the group chat` (or `supergroup chat`, `channel chat`) | The bot is not a member there, for example after it left |
| `Forbidden: the group chat was deleted` | The basic group no longer exists |

Telegram says the numeric `error_code` may change in the future[1], so decide on the HTTP status your library already mapped (403) together with the description, not on the number alone.

## How is it different from blocked by the user and chat not found?

Three errors show up in the same broadcast logs and need different handling:

| Error | Code | Where | Meaning | What to do |
| --- | --- | --- | --- | --- |
| `Forbidden: bot was kicked from the group chat` | 403 | Group, supergroup, channel | An admin removed the bot | Mark the chat inactive until the bot is added back |
| `Forbidden: bot was blocked by the user` | 403 | Private chat | The user blocked the bot | Mark the user inactive until they unblock it |
| `Bad Request: chat not found` | 400 | Any | The bot does not know this chat at all | Fix the `chat_id` or the token |

The first two are about a chat that exists and has shut the bot out; Telegram answers 403 for both[2]. The blocked case has its own page: [Forbidden: bot was blocked by the user](https://livops.dev/en/guides/error-telegram-bot-was-blocked-by-the-user). The third is a 400: the id is wrong, or this bot has never been in that chat, and the fix is in your data, not in a flag — see [Bad Request: chat not found](https://livops.dev/en/guides/error-telegram-chat-not-found). A basic group that became a supergroup returns another 400 with the new id in it: [group chat was upgraded to a supergroup chat](https://livops.dev/en/guides/error-telegram-group-chat-upgraded-to-supergroup).

## Learn about it before you send: my_chat_member

You do not have to wait for a failed send. Telegram sends the bot a `my_chat_member` update whenever the bot's own status in a chat changes[1]. The update is a `ChatMemberUpdated` with `old_chat_member` and `new_chat_member`; when the bot is removed, the new status is `kicked` (the member was banned and cannot return or see messages) or `left` (not a member now, but may join again)[1]. When someone adds the bot back, another `my_chat_member` arrives with a member or administrator status.

Two details make this work:

- **Receive the update.** `my_chat_member` is in the default set: an empty `allowed_updates` list means every type except `chat_member`, `message_reaction` and `message_reaction_count`. If your bot passes its own list to `getUpdates` or `setWebhook`, put `"my_chat_member"` in it. A list you set once stays in force: when the parameter is not specified, the previous setting is used[1]. In aiogram 3, `start_polling` builds the list from the handlers you registered when you do not pass one[7], so a `my_chat_member` handler is enough with polling; with a webhook, pass `dp.resolve_used_update_types()` to `set_webhook`.
- **Do not rely on it alone.** Telegram keeps undelivered updates for at most 24 hours[1]. A bot that was down longer than that can miss the removal, and chats the bot joined before you added tracking are not in your table yet. Catch the 403 on send as well.

In aiogram, `ChatMemberUpdatedFilter(IS_MEMBER >> IS_NOT_MEMBER)` matches the transition from member to not-member, and `IS_NOT_MEMBER` covers both `LEFT` and `KICKED`[6].

## A complete aiogram 3 bot

One file. It records every group, supergroup and channel the bot is added to, marks it inactive when the bot is removed, and gives the admin a `/broadcast` command that skips inactive chats and survives a 403 in the middle of the list. The token comes from `BOT_TOKEN`, the admin's numeric user id from `ADMIN_ID`.

```python
import asyncio
import logging
import os
import sqlite3

from aiogram import Bot, Dispatcher, F, Router
from aiogram.exceptions import TelegramAPIError, TelegramForbiddenError, TelegramRetryAfter
from aiogram.filters import IS_MEMBER, IS_NOT_MEMBER, ChatMemberUpdatedFilter, Command, CommandObject
from aiogram.types import ChatMemberUpdated, Message

db = sqlite3.connect(os.path.join(os.environ.get("DATA_DIR", "."), "chats.db"))
db.execute("CREATE TABLE IF NOT EXISTS chats (chat_id INTEGER PRIMARY KEY, active INTEGER NOT NULL)")


def set_active(chat_id: int, active: bool) -> None:
    db.execute(
        "INSERT INTO chats (chat_id, active) VALUES (?, ?) "
        "ON CONFLICT(chat_id) DO UPDATE SET active = excluded.active",
        (chat_id, int(active)),
    )
    db.commit()


router = Router()
not_private = F.chat.type.in_({"group", "supergroup", "channel"})


@router.my_chat_member(not_private, ChatMemberUpdatedFilter(IS_NOT_MEMBER >> IS_MEMBER))
async def on_added(event: ChatMemberUpdated) -> None:
    set_active(event.chat.id, True)


@router.my_chat_member(not_private, ChatMemberUpdatedFilter(IS_MEMBER >> IS_NOT_MEMBER))
async def on_removed(event: ChatMemberUpdated) -> None:
    logging.info("removed from %s, status %s", event.chat.id, event.new_chat_member.status)
    set_active(event.chat.id, False)


async def send_one(bot: Bot, chat_id: int, text: str) -> None:
    while True:
        try:
            await bot.send_message(chat_id, text)
            return
        except TelegramRetryAfter as e:  # 429: wait as asked, then send again
            await asyncio.sleep(e.retry_after)


async def broadcast(bot: Bot, text: str) -> tuple[int, int]:
    chat_ids = [row[0] for row in db.execute("SELECT chat_id FROM chats WHERE active = 1")]
    sent = skipped = 0
    for chat_id in chat_ids:
        try:
            await send_one(bot, chat_id, text)
            sent += 1
        except TelegramForbiddenError as e:  # 403: kicked, not a member, blocked
            logging.warning("skip %s: %s", chat_id, e.message)
            set_active(chat_id, False)
            skipped += 1
        except TelegramAPIError as e:  # anything else: log it and go on
            logging.error("failed %s: %s", chat_id, e.message)
            skipped += 1
        await asyncio.sleep(0.1)
    return sent, skipped


@router.message(Command("broadcast"), F.from_user.id == int(os.environ["ADMIN_ID"]))
async def on_broadcast(message: Message, command: CommandObject, bot: Bot) -> None:
    if not command.args:
        await message.answer("Usage: /broadcast <text>")
        return
    sent, skipped = await broadcast(bot, command.args)
    await message.answer(f"Sent {sent}, skipped {skipped}")


async def main() -> None:
    logging.basicConfig(level=logging.INFO)
    bot = Bot(os.environ["BOT_TOKEN"])
    dp = Dispatcher()
    dp.include_router(router)
    await dp.start_polling(bot)  # allowed_updates is built from the handlers above


if __name__ == "__main__":
    asyncio.run(main())
```

What each part does:

- **The exception.** aiogram turns every HTTP 403 from Telegram into `TelegramForbiddenError`, and its `message` holds Telegram's description[5][4]. A response that carries `retry_after` becomes `TelegramRetryAfter` instead, with the wait in seconds[5][4].
- **The order of the `except` blocks.** `TelegramForbiddenError` comes before the general `TelegramAPIError`, which is the base of every Telegram error in aiogram[4]. A 403 marks the chat inactive; any other failure is logged and the loop moves on, so one bad chat never stops the rest.
- **No retry on 403.** Only the 429 is retried, after the wait Telegram asks for. The pause between sends is yours to tune; why it matters is in [Telegram 429: Too Many Requests](https://livops.dev/en/guides/error-telegram-429-too-many-requests).
- **Chat ids as 64-bit integers.** SQLite's `INTEGER` holds a channel id such as `-1001234567890`. In PostgreSQL use `BIGINT`.

## python-telegram-bot v21

The same rules, other names. A 403 becomes `telegram.error.Forbidden`[9], which was called `Unauthorized` before version 20.0[8]. In the broadcast loop:

```python
from telegram.error import Forbidden

try:
    await context.bot.send_message(chat_id, text)
except Forbidden as e:
    set_active(chat_id, False)
```

For the status changes, python-telegram-bot's own `chatmemberbot.py` example registers `ChatMemberHandler(track_chats, ChatMemberHandler.MY_CHAT_MEMBER)` and starts with `application.run_polling(allowed_updates=Update.ALL_TYPES)` so that the member updates reach it[10].

## If you want the bot back in the chat

Nothing in your code can undo the removal. The Bot API has no method for a bot to join a chat[1]; users add bots to their groups and channels[3]. Ask an administrator of that chat to add the bot again. The `my_chat_member` update that follows flips the row back to active, and the next broadcast includes it.

If the bot should leave a chat on purpose, call `leaveChat`[1], and mark the chat inactive yourself at the same time: afterwards sends there fail with a 403, which in the Bot API server's code is `Forbidden: bot is not a member of ...`[2].

## On Livops

Livops does not filter or retry your sends; the handling above lives in your code. What Livops gives you is the place to run it:

- **The bot as a Bot.** A bot runs as the `bot` type: always on, no public URL needed. Its exceptions and the `skip` lines from the loop are on the project's **Logs** page and in the terminal with `livops logs <service> -f`.
- **The table survives a deploy.** The project has its own disk at `/app/data`, and its path is in `DATA_DIR`, which is why the example builds the SQLite path from it. A file written anywhere else is not kept. See [Files and data](https://livops.dev/en/docs/files).
- **PostgreSQL when more than one service reads it.** If a separate worker sends the broadcasts, keep the chats table in PostgreSQL: add it under **Databases**, and `DATABASE_URL` is written into every service in the environment, including ones added later. Store chat ids as `BIGINT`.
- **The broadcast as a worker or a cron job.** A `worker` is an always-on background process with no public URL; a `cron` service runs on a schedule read in UTC. Either one must only send and never call `getUpdates`, or it conflicts with the bot. The setup is in [Cron and workers](https://livops.dev/en/docs/cron-workers).

A bot, worker or cron job costs **19 credits a month** (19,000 so'm); see [Pricing](https://livops.dev/en/docs/pricing).

## Questions

**Can the bot rejoin the group by itself?**

No. The Bot API has no method for a bot to join a chat. Someone in the group or channel has to add it again, and then your bot gets a my_chat_member update with its new status, so you can mark the chat active.

**Should I retry the message later?**

No. The 403 stays until somebody adds the bot back, so a retry sends the same request and gets the same answer. Mark the chat inactive and skip it. Keep retries for 429 Too Many Requests, which asks you to wait and send again.

**What is the difference between kicked and not a member?**

Kicked means the bot was removed and banned from that chat; its status there is kicked. Not a member means its status is left, for example because it left the chat itself with leaveChat. Both are 403s, and for a sender both mean stop writing to this chat.

**Is this the same as bot was blocked by the user?**

It is the same idea in a different place. Blocked by the user is a private chat: one person blocked the bot. Kicked is a group, supergroup or channel: an administrator removed the bot. Handle both by marking the chat inactive.

**Why did I not get a my_chat_member update?**

Usually because the bot asks Telegram for a list of update types that leaves it out. Check allowed_updates in getUpdates or setWebhook. Telegram also keeps undelivered updates for at most 24 hours, so a bot that was down longer can miss one. Catching the 403 on send covers that case.

**Does this error crash my bot?**

Only if the exception escapes your code. In a broadcast loop, catch it around each send and carry on with the next chat. Without that, one group that removed the bot stops the loop for every chat after it.

## Sources

1. [Telegram Bot API — Making requests, Update, getUpdates, setWebhook, ChatMemberUpdated, ChatMember, leaveChat](https://core.telegram.org/bots/api). Checked 3 December 2026.
2. [Telegram Bot API server source — telegram-bot-api/Client.cpp](https://raw.githubusercontent.com/tdlib/telegram-bot-api/master/telegram-bot-api/Client.cpp). Checked 3 December 2026.
3. [Telegram — Bots, an introduction for developers](https://core.telegram.org/bots). Checked 3 December 2026.
4. [aiogram source — aiogram/exceptions.py](https://raw.githubusercontent.com/aiogram/aiogram/dev-3.x/aiogram/exceptions.py). Checked 3 December 2026.
5. [aiogram source — aiogram/client/session/base.py](https://raw.githubusercontent.com/aiogram/aiogram/dev-3.x/aiogram/client/session/base.py). Checked 3 December 2026.
6. [aiogram docs source — ChatMemberUpdated filter](https://raw.githubusercontent.com/aiogram/aiogram/dev-3.x/docs/dispatcher/filters/chat_member_updated.rst). Checked 3 December 2026.
7. [aiogram source — aiogram/dispatcher/dispatcher.py](https://raw.githubusercontent.com/aiogram/aiogram/dev-3.x/aiogram/dispatcher/dispatcher.py). Checked 3 December 2026.
8. [python-telegram-bot source — telegram/error.py](https://raw.githubusercontent.com/python-telegram-bot/python-telegram-bot/master/src/telegram/error.py). Checked 3 December 2026.
9. [python-telegram-bot source — telegram/request/_baserequest.py](https://raw.githubusercontent.com/python-telegram-bot/python-telegram-bot/master/src/telegram/request/_baserequest.py). Checked 3 December 2026.
10. [python-telegram-bot example — examples/chatmemberbot.py](https://raw.githubusercontent.com/python-telegram-bot/python-telegram-bot/master/examples/chatmemberbot.py). Checked 3 December 2026.
