2.1 Теперь функции принимает новые аргументы
This commit is contained in:
@@ -17,13 +17,27 @@ from SQLite3 import base_sql
|
|||||||
__all__ = ("CommandHandler",)
|
__all__ = ("CommandHandler",)
|
||||||
|
|
||||||
class CommandHandler:
|
class CommandHandler:
|
||||||
def __init__(self, name: str, keywords: list, func: Optional[list[Callable]] = None, text_msg=None, chat_action: bool = False,
|
def __init__(self, name: str,
|
||||||
description: str = "Описание команды", tg_links: bool = False,
|
keywords: list,
|
||||||
keyboard=None, prefix=BotVar.prefix, callbackdata: list = None, only_admin: bool = False,
|
func: Optional[list[Callable]] = None,
|
||||||
ignore_case: bool = True, activate_keywords: bool = True, delete_msg: bool = False,
|
text_msg=None,
|
||||||
activate_commands: bool = True, activate_callback: bool = True,
|
chat_action: bool = False,
|
||||||
media: str = "message", path_to_media=None, parse_mode: str = BotVar.parse_mode,
|
description: str = "Описание команды",
|
||||||
disable_notification: bool = BotVar.disable_notification, protect: bool = BotVar.protect_content):
|
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.router = Router(name=f"{name}_router")
|
||||||
self.name = name
|
self.name = name
|
||||||
self.log_type = name.capitalize()
|
self.log_type = name.capitalize()
|
||||||
@@ -344,7 +358,7 @@ class CommandHandler:
|
|||||||
caption=text if is_last else None,
|
caption=text if is_last else None,
|
||||||
reply_markup=self.keyboard() if is_last and self.keyboard else None,
|
reply_markup=self.keyboard() if is_last and self.keyboard else None,
|
||||||
parse_mode=self.parse_mode,
|
parse_mode=self.parse_mode,
|
||||||
disable_notification=self.disable_notification,
|
disable_notificatioввn=self.disable_notification,
|
||||||
protect_content=self.protect,
|
protect_content=self.protect,
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user