From c448a389189b0b42f72d364c11b5f4efb016d291 Mon Sep 17 00:00:00 2001 From: Verum Date: Sun, 16 Mar 2025 02:12:50 +0700 Subject: [PATCH] =?UTF-8?q?2.1=20=D0=A2=D0=B5=D0=BF=D0=B5=D1=80=D1=8C=20?= =?UTF-8?q?=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B8=20=D0=BF=D1=80=D0=B8?= =?UTF-8?q?=D0=BD=D0=B8=D0=BC=D0=B0=D0=B5=D1=82=20=D0=BD=D0=BE=D0=B2=D1=8B?= =?UTF-8?q?=D0=B5=20=D0=B0=D1=80=D0=B3=D1=83=D0=BC=D0=B5=D0=BD=D1=82=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BotLibrary/samples/user_cmd_class.py | 30 ++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/BotLibrary/samples/user_cmd_class.py b/BotLibrary/samples/user_cmd_class.py index 2d89326..3536223 100644 --- a/BotLibrary/samples/user_cmd_class.py +++ b/BotLibrary/samples/user_cmd_class.py @@ -17,13 +17,27 @@ from SQLite3 import base_sql __all__ = ("CommandHandler",) class CommandHandler: - def __init__(self, name: str, keywords: list, func: Optional[list[Callable]] = None, text_msg=None, chat_action: bool = False, - description: str = "Описание команды", tg_links: bool = False, - keyboard=None, prefix=BotVar.prefix, callbackdata: list = None, only_admin: bool = False, - ignore_case: bool = True, activate_keywords: bool = True, delete_msg: bool = False, - activate_commands: bool = True, activate_callback: bool = True, - media: str = "message", path_to_media=None, parse_mode: str = BotVar.parse_mode, - disable_notification: bool = BotVar.disable_notification, protect: bool = BotVar.protect_content): + def __init__(self, name: str, + keywords: list, + func: Optional[list[Callable]] = None, + text_msg=None, + chat_action: bool = False, + description: str = "Описание команды", + tg_links: bool = False, + keyboard=None, + prefix=BotVar.prefix, + callbackdata: list = None, + only_admin: bool = False, + ignore_case: bool = True, + activate_keywords: bool = True, + delete_msg: bool = False, + activate_commands: bool = True, + activate_callback: bool = True, + media: str = "message", + path_to_media=None, + parse_mode: str = BotVar.parse_mode, + disable_notification: bool = BotVar.disable_notification, + protect: bool = BotVar.protect_content): self.router = Router(name=f"{name}_router") self.name = name self.log_type = name.capitalize() @@ -344,7 +358,7 @@ class CommandHandler: caption=text if is_last else None, reply_markup=self.keyboard() if is_last and self.keyboard else None, parse_mode=self.parse_mode, - disable_notification=self.disable_notification, + disable_notificatioввn=self.disable_notification, protect_content=self.protect, ) else: