diff --git a/requirements.txt b/requirements.txt index 8c86ef89d..119c6134a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ git+https://github.com/pyrogram/pyrogram.git@asyncio-dev -BeautifulSoup +bs4 cowpy dnspython emoji diff --git a/userge/core/_userge/client.py b/userge/core/_userge/client.py index fbe95466e..634011d59 100644 --- a/userge/core/_userge/client.py +++ b/userge/core/_userge/client.py @@ -44,6 +44,7 @@ def __init__(self) -> None: self.__help_dict: Dict[str, Dict[str, str]] = {} self.__imported: List[ModuleType] = [] + self.__channel = self.getCLogger(__name__) LOG.info(LOG_STR, "Setting Userge Configs") @@ -145,8 +146,9 @@ async def send_message(self, Text of the message to be sent. del_in (``int``): Time in Seconds for delete that message. - log (``bool``, *optional*): + log (``bool`` | ``str``, *optional*): If ``True``, the message will be forwarded to the log channel. + If ``str``, the logger name will be updated. parse_mode (``str``, *optional*): By default, texts are parsed using both Markdown and HTML styles. You can combine both syntaxes together. @@ -179,7 +181,10 @@ async def send_message(self, reply_markup=reply_markup) if log: - await self.getCLogger(__name__).fwd_msg(msg) + if isinstance(log, str): + self.__channel.update(log) + + await self.__channel.fwd_msg(msg) del_in = del_in or Config.MSG_DELETE_TIMEOUT