Init project

This commit is contained in:
2026-01-15 09:47:43 +03:00
commit 3e515c66ec
59 changed files with 5101 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
from typing import Any, Awaitable, Callable
import aiogram
from aiogram.types import TelegramObject
class DependsMiddleware(aiogram.BaseMiddleware):
def __init__(self, name: str, object_: Any):
self._name = name
self._object = object_
async def __call__(
self,
handler: Callable[[TelegramObject, dict[str, Any]], Awaitable[Any]],
event: TelegramObject,
data: dict[str, Any],
):
data[self._name] = self._object
return await handler(event, data)