aiogram/aiogram/dispatcher/middlewares/base.py
2020-05-26 00:23:35 +03:00

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