15 lines
410 B
Python
15 lines
410 B
Python
from typing import Any, Awaitable, Callable
|
|
|
|
from aiogram import BaseMiddleware
|
|
from aiogram.types import Update
|
|
|
|
|
|
class GetUserMiddleware(BaseMiddleware):
|
|
async def __call__(
|
|
self,
|
|
handler: Callable[[Update, dict[str, Any]], Awaitable[Any]],
|
|
event: Update,
|
|
data: dict[str, Any],
|
|
):
|
|
data.update(user={"is_admin": False})
|
|
return await handler(event, data) |