mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 09:22:03 +00:00
15 lines
380 B
Python
15 lines
380 B
Python
from abc import ABC, abstractmethod
|
|
from typing import Any, Awaitable, Callable, Dict, Generic, TypeVar
|
|
|
|
T = TypeVar("T")
|
|
|
|
|
|
class BaseMiddleware(ABC, Generic[T]):
|
|
@abstractmethod
|
|
async def __call__(
|
|
self,
|
|
handler: Callable[[T, Dict[str, Any]], Awaitable[Any]],
|
|
event: T,
|
|
data: Dict[str, Any],
|
|
) -> Any: # pragma: no cover
|
|
pass
|