Почему я получаю ошибку Update id == ... is not handled?

Всем привет, написал такой код:

import asyncio
import contextlib
from aiogram.types import ChatJoinRequest
from aiogram import Bot, Dispatcher, F
import logging

bot_token = "TOKEN"
channel_id = "TOKEN"
admin = "TOKEN"


async def approve_req(chat_join: ChatJoinRequest, bot: Bot):
    await bot.send_message(chat_id=chat_join.from_user.id, text="Привет")
    await chat_join.approve()


async def start():
    logging.basicConfig(level=logging.DEBUG,
                        format="%(asctime)s - [%(levelname)s] - %(name)s - (%(filename)s).%(funcName)s(%(lineno)d) - %(message)s"
                        )
    bot: Bot = Bot(token=bot_token)
    dp = Dispatcher()
    dp.chat_join_request.register(approve_req, F.chat.id == channel_id)

    try:
        await dp.start_polling(bot, allowed_updates=dp.resolve_used_update_types())
    except Exception as ex:
        logging.error(f'Exception: {ex}', exc_info=True)
    finally:
        await bot.session.close()


if __name__ == "__main__":
    with contextlib.suppress(KeyboardInterrupt, SystemExit):
        asyncio.run(start())

И в итоге получаю такую ошибку:

2024-01-11 00:20:30,667 - [INFO] - aiogram.event - (dispatcher.py).feed_update(172) - Update id=550090795 is not handled. Duration 0 ms by bot id=6973076585

Что я делаю не так?


Ответы (0 шт):