add profile dialog

This commit is contained in:
2025-09-25 20:48:39 +03:00
parent 8c801eb66e
commit cbe1919343
12 changed files with 117 additions and 14 deletions

View File

@@ -0,0 +1,3 @@
from .get_user import GetUserMiddleware
__all__ = ["GetUserMiddleware"]

View File

@@ -0,0 +1,15 @@
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)