This commit is contained in:
xds
2026-02-02 16:15:17 +03:00
commit e6aad48e72
21 changed files with 631 additions and 0 deletions

13
middlewares/dao.py Normal file
View File

@@ -0,0 +1,13 @@
from aiogram import BaseMiddleware
from aiogram.types import TelegramObject
from repos.dao import DAO
class DaoMiddleware(BaseMiddleware):
def __init__(self, dao: DAO):
self._dao = dao
async def __call__(self, handler, event: TelegramObject, data: dict):
data["dao"] = self._dao
return await handler(event, data)