mirror of
https://github.com/MrSedan/neuro-reply-bot-reworked.git
synced 2026-01-14 21:49:42 +03:00
17 lines
584 B
Python
17 lines
584 B
Python
from typing import Any, Awaitable, Callable, Dict
|
|
|
|
from aiogram import BaseMiddleware
|
|
from aiogram.types import Message
|
|
|
|
ADMIN_LIST = [248770879, 395543883]
|
|
|
|
class AdminMiddleware(BaseMiddleware):
|
|
def __init__(self) -> None:
|
|
pass
|
|
|
|
async def __call__(self, handler: Callable[[Message, Dict[str, Any]], Awaitable[Any]], event: Message, data: Dict[str, Any]) -> Any:
|
|
if event.from_user.id in ADMIN_LIST:
|
|
await event.answer('Команда только для админов!')
|
|
return None
|
|
return await handler(event, data)
|
|
|