Skip to content

Commit

Permalink
Update client.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerpq authored Oct 30, 2023
1 parent 3f72c96 commit 9ed3fbf
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions repthon/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]]]
Expand Down Expand Up @@ -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())
Expand All @@ -206,26 +206,26 @@ 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,
from_users=_sudousers_list(),
**kwargs,
),
)
zedub.add_event_handler(
zq_lo.add_event_handler(
wrapper,
NewMessage(
pattern=REGEX_.regex2,
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 9ed3fbf

Please sign in to comment.