Added usage example of errors_handler
Optimized generation of default/inline keyboard Customizing webhook path has become more flexible Updated aiogram version to 2.7 (BotAPI 4.7)
This commit is contained in:
9
handlers/errors/__init__.py
Normal file
9
handlers/errors/__init__.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from aiogram import Dispatcher
|
||||
from aiogram.utils import exceptions
|
||||
|
||||
from .not_modified import message_not_modified, message_to_delete_not_found
|
||||
|
||||
|
||||
def setup(dp: Dispatcher):
|
||||
dp.register_errors_handler(message_not_modified, exception=exceptions.MessageNotModified)
|
||||
dp.register_errors_handler(message_to_delete_not_found, exception=exceptions.MessageToDeleteNotFound)
|
||||
10
handlers/errors/not_modified.py
Normal file
10
handlers/errors/not_modified.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from aiogram import types
|
||||
from aiogram.utils import exceptions
|
||||
|
||||
|
||||
async def message_not_modified(update: types.Update, error: exceptions.MessageNotModified):
|
||||
return True
|
||||
|
||||
|
||||
async def message_to_delete_not_found(update: types.Update, error: exceptions.MessageToDeleteNotFound):
|
||||
return True
|
||||
Reference in New Issue
Block a user