From b793233c0b324007a950403866c4cf444690c184 Mon Sep 17 00:00:00 2001 From: Whyverum Date: Mon, 23 Dec 2024 22:05:28 +0700 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D1=87=D0=B8=D0=BA=20=D0=BA=D0=BE=D0=BC=D0=B0=D0=BD=D0=B4=D1=8B?= =?UTF-8?q?=20/secret?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../routers/administration/admin_cmd/secret_cmd.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/BotCode/routers/administration/admin_cmd/secret_cmd.py b/BotCode/routers/administration/admin_cmd/secret_cmd.py index 17e7847..223a83b 100644 --- a/BotCode/routers/administration/admin_cmd/secret_cmd.py +++ b/BotCode/routers/administration/admin_cmd/secret_cmd.py @@ -7,6 +7,9 @@ from BotLibrary import * # Создание роутера и настройка экспорта модулей __all__ = ("router",) + +from routers.msg_default import msg_default + router = Router(name="secret_message_router") log_type = "Admin" @@ -16,12 +19,13 @@ keywords = ["secret", "секрет", "ыускуе", "ctrhtn", # Обработчик команды /secret или сообщений с текстом из списка keywords -@router.message(F.from_user.id.in_(ListId.important_ids), - Command(*keywords, prefix=BotEdit.prefixs, ignore_case=True)) -@router.message(F.from_user.id.in_(ListId.important_ids), F.text.lower().in_(keywords)) +@router.message(F.from_user.id.func(lambda user_id: str(user_id) in DataID.important.keys()), + Command(*keywords, prefix=BotVariables.prefixs, ignore_case=True)) +@router.message(F.from_user.id.func(lambda user_id: str(user_id) in DataID.important.keys()), + F.text.lower().in_(keywords)) async def secret_admin_message(message: types.Message): text = f"Привет, важная персона!" await message.reply(text) await cmd_logginger(message, log_type, text) - return text + await msg_default(message)