From 70fe59bc81ffc0277c3dc1a20f5197f228ff1f16 Mon Sep 17 00:00:00 2001 From: David Dzhalaev <72649244+DavidRomanovizc@users.noreply.github.com> Date: Sun, 27 Aug 2023 14:04:40 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=92=EF=B8=8F=20Add=20custom=20filter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handlers/groups/event_moderate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/handlers/groups/event_moderate.py b/handlers/groups/event_moderate.py index 9a3429e7..b967c389 100644 --- a/handlers/groups/event_moderate.py +++ b/handlers/groups/event_moderate.py @@ -3,20 +3,22 @@ from aiogram.types import CallbackQuery from data.config import load_config +from filters.IsAdminFilter import IsAdmin from keyboards.inline.main_menu_inline import start_keyboard from keyboards.inline.poster_inline import poster_keyboard from loader import dp, bot, _ from utils.db_api import db_commands +# FIXME: Broken handler @dp.callback_query_handler( + IsAdmin(), lambda call: str(call.message.chat.id) == load_config().tg_bot.moderate_chat ) async def order_answer(call: CallbackQuery) -> None: call_data = call.data.split("-") telegram_id = call_data[1] markup = await start_keyboard(obj=int(telegram_id)) - if call_data[0] == "moderate_accept": await call.message.delete() await call.message.answer(_("Принято!")) @@ -31,7 +33,7 @@ async def order_answer(call: CallbackQuery) -> None: text=_("Ваше мероприятие прошло модерацию"), reply_markup=markup, ) - await asyncio.sleep(3) + await asyncio.sleep(1) elif call_data[0] == "moderate_decline": await call.message.delete()