class aiogram.dispatcher.middlewares.base.BaseMiddleware[source]
Bases: ABC
Generic middleware class7
abstract async __call__(handler: Callable[[TelegramObject, Dict[str, Any]], Awaitable[Any]], event: TelegramObject, data: Dict[str, Any]) → Any[source]
Execute middleware
PARAMETERS:
handler – Wrapped handler in middlewares chain
event – Incoming event (Subclass of aiogram.types.base.TelegramObject)
data – Contextual data. Will be mapped to handler arguments
RETURNS:
Any
С помощью методов этого класса можно перехватить любое событие.