replace-bot/handlers/errors/main.py

12 lines
331 B
Python
Raw Normal View History

2022-02-16 18:13:44 +03:00
import logging
2022-10-07 17:50:42 +03:00
from aiogram.utils.exceptions import BotBlocked, MessageNotModified
2022-02-16 18:13:44 +03:00
from load import dp
@dp.errors_handler()
async def errors_handler(update, exception):
if isinstance(exception, BotBlocked):
logging.info("Bot blocked")
2022-10-07 17:50:42 +03:00
return True
if isinstance(exception, MessageNotModified): return True