Files
h1686bot/bot/middlewares/like_middleware.py
2025-01-02 22:19:43 +02:00

17 lines
484 B
Python

from typing import Any, Awaitable, Callable, Dict
from aiogram import BaseMiddleware
from aiogram.types import Message, ReactionTypeEmoji
class LikeMiddleware(BaseMiddleware):
async def __call__(
self,
handler: Callable[[Message, Dict[str, Any]], Awaitable[Any]],
event: Message,
data: Dict[str, Any],
) -> Any:
res = await handler(event, data)
await event.react(reaction=[ReactionTypeEmoji(emoji="")])
return res