Бот не обрабатывает блокировку пользователями, из-за чего их ID, если они подписались на рассылку, остаются в БД, и при попытке отправить им рассылку бот вызывает исключение.
Task exception was never retrieved
future: <Task finished name='Task-3' coro=<mailing() done, defined at /app/app/mailing.py:16> exception=BotBlocked('Forbidden: bot was blocked by the user')>
Traceback (most recent call last):
File "/app/app/mailing.py", line 26, in mailing
await send_mailing(bot, mailing_time.time())
File "/app/app/mailing.py", line 51, in send_mailing
await bot.send_sticker(user_id, sticker)
File "/app/.heroku/python/lib/python3.9/site-packages/aiogram/bot/bot.py", line 2534, in send_sticker
result = await self.request(api.Methods.SEND_STICKER, payload, files)
File "/app/.heroku/python/lib/python3.9/site-packages/aiogram/bot/base.py", line 208, in request
return await api.make_request(self.session, self.server, self.__token, method, data, files,
File "/app/.heroku/python/lib/python3.9/site-packages/aiogram/bot/api.py", line 140, in make_request
return check_result(method, response.content_type, response.status, await response.text())
File "/app/.heroku/python/lib/python3.9/site-packages/aiogram/bot/api.py", line 121, in check_result
exceptions.Unauthorized.detect(description)
File "/app/.heroku/python/lib/python3.9/site-packages/aiogram/utils/exceptions.py", line 140, in detect
raise err(cls.text or description)
aiogram.utils.exceptions.BotBlocked: Forbidden: bot was blocked by the user