add profile dialog
This commit is contained in:
3
app/bot/middlewares/__init__.py
Normal file
3
app/bot/middlewares/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from .get_user import GetUserMiddleware
|
||||
|
||||
__all__ = ["GetUserMiddleware"]
|
||||
15
app/bot/middlewares/get_user.py
Normal file
15
app/bot/middlewares/get_user.py
Normal 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)
|
||||
Reference in New Issue
Block a user