Files
FascioSchoolBot/app/bot/middlewares/get_user.py
2025-09-25 20:48:39 +03:00

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)