From 9ed3fbf519ddf557aa1a47d693f8e7d51cd69cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=B1=D9=88=D8=AC=D8=B1?= <104784913+rogerpq@users.noreply.github.com> Date: Mon, 30 Oct 2023 19:46:11 +0300 Subject: [PATCH] Update client.py --- repthon/core/client.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/repthon/core/client.py b/repthon/core/client.py index 2baa30a..38a3df1 100644 --- a/repthon/core/client.py +++ b/repthon/core/client.py @@ -49,7 +49,7 @@ def __init__(self): class ZedUserBotClient(TelegramClient): - def zed_cmd( + def rep_cmd( self: TelegramClient, pattern: str or tuple = None, info: Union[str, Dict[str, Union[str, List[str], Dict[str, str]]]] @@ -193,7 +193,7 @@ async def wrapper(check): # sourcery no-metrics Config.PRIVATE_GROUP_BOT_API_ID, text, link_preview=False ) - from .session import zedub + from .session import zq_lo if not func.__doc__ is None: CMD_INFO[command[0]].append((func.__doc__).strip()) @@ -206,18 +206,18 @@ async def wrapper(check): # sourcery no-metrics except BaseException: LOADED_CMDS.update({command[0]: [wrapper]}) if edited: - zedub.add_event_handler( + zq_lo.add_event_handler( wrapper, MessageEdited(pattern=REGEX_.regex1, outgoing=True, **kwargs), ) - zedub.add_event_handler( + zq_lo.add_event_handler( wrapper, NewMessage(pattern=REGEX_.regex1, outgoing=True, **kwargs), ) if allow_sudo and gvarstatus("sudoenable") is not None: if command is None or command[0] in sudo_enabledcmds: if edited: - zedub.add_event_handler( + zq_lo.add_event_handler( wrapper, MessageEdited( pattern=REGEX_.regex2, @@ -225,7 +225,7 @@ async def wrapper(check): # sourcery no-metrics **kwargs, ), ) - zedub.add_event_handler( + zq_lo.add_event_handler( wrapper, NewMessage( pattern=REGEX_.regex2, @@ -241,8 +241,8 @@ async def wrapper(check): # sourcery no-metrics except BaseException: LOADED_CMDS.update({file_test: [func]}) if edited: - zedub.add_event_handler(func, events.MessageEdited(**kwargs)) - zedub.add_event_handler(func, events.NewMessage(**kwargs)) + zq_lo.add_event_handler(func, events.MessageEdited(**kwargs)) + zq_lo.add_event_handler(func, events.NewMessage(**kwargs)) return wrapper return decorator @@ -312,12 +312,12 @@ async def wrapper(check): Config.PRIVATE_GROUP_BOT_API_ID, text, link_preview=False ) - from .session import zedub + from .session import zq_lo if edited is True: - zedub.tgbot.add_event_handler(func, events.MessageEdited(**kwargs)) + zq_lo.tgbot.add_event_handler(func, events.MessageEdited(**kwargs)) else: - zedub.tgbot.add_event_handler(func, events.NewMessage(**kwargs)) + zq_lo.tgbot.add_event_handler(func, events.NewMessage(**kwargs)) return wrapper