S
S
sousagemonster2022-02-09 01:43:47
Bots
sousagemonster, 2022-02-09 01:43:47

ERROR:asyncio:Task exception was never retrieved how can I fix it?

I am writing a bot on the AioGram library.

When the bot is launched, the entire console per second is clogged with errors like:

ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-274' coro=<Dispatcher._process_polling_updates() done, defined at C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\dispatcher.py:407> exception=RetryAfter('Flood control exceeded. Retry in 25 seconds.')>
Traceback (most recent call last):
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\dispatcher.py", line 415, in _process_polling_updates
    for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\dispatcher.py", line 235, in process_updates
    return await asyncio.gather(*tasks)
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\handler.py", line 116, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\dispatcher.py", line 256, in process_update
    return await self.message_handlers.notify(update.message)
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\handler.py", line 107, in notify
    data.update(await check_filters(handler_obj.filters, args))
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\filters\filters.py", line 72, in check_filters
    f = await execute_filter(filter_, args)
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\filters\filters.py", line 56, in execute_filter
    return await filter_.filter(*args, **filter_.kwargs)
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\filters\filters.py", line 161, in __call__
    return await self.check(*args)
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\filters\builtin.py", line 691, in check
    admins = [member.user.id for chat_id in chat_ids for member in await obj.bot.get_chat_administrators(chat_id)]
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\dispatcher\filters\builtin.py", line 691, in <listcomp>
    admins = [member.user.id for chat_id in chat_ids for member in await obj.bot.get_chat_administrators(chat_id)]
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\bot\bot.py", line 2380, in get_chat_administrators
    result = await self.request(api.Methods.GET_CHAT_ADMINISTRATORS, payload)
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\bot\base.py", line 231, in request
    return await api.make_request(await self.get_session(), self.server, self.__token, method, data, files,
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\bot\api.py", line 140, in make_request
    return check_result(method, response.content_type, response.status, await response.text())
  File "C:\Users\Сас\AppData\Roaming\Python\Python310\site-packages\aiogram\bot\api.py", line 111, in check_result
    raise exceptions.RetryAfter(parameters.retry_after)
aiogram.utils.exceptions.RetryAfter: Flood control exceeded. Retry in 25 seconds.


The bot only works in PM, it doesn’t respond at all in groups

I can’t figure it out, it worked fine two days ago, and now it’s like this ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Shelby_coder, 2022-02-10
@Shelby_coder

Read the last line))
And so that this does not happen after you turn on the bot:
executor.start_polling(dp, skip_updates=True)
And you also asked me to make a payment, do not use Russian names, huh?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question