From 279a8e9d840c451f1eb1d18c6dc7a938d18a9f50 Mon Sep 17 00:00:00 2001 From: profitroll Date: Mon, 3 Jul 2023 10:56:24 +0200 Subject: [PATCH] reports.chat_id can now be "owner" --- libbot/pyrogram/classes/client.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libbot/pyrogram/classes/client.py b/libbot/pyrogram/classes/client.py index a33b46b..4f29eff 100644 --- a/libbot/pyrogram/classes/client.py +++ b/libbot/pyrogram/classes/client.py @@ -128,7 +128,9 @@ class PyroClient(Client): try: await self.send_message( - chat_id=self.config["reports"]["chat_id"], + chat_id=self.owner + if self.config["reports"]["chat_id"] == "owner" + else self.config["reports"]["chat_id"], text=f"Bot started PID `{getpid()}`", ) @@ -150,7 +152,9 @@ class PyroClient(Client): async def stop(self, exit_completely: bool = True): try: await self.send_message( - chat_id=self.config["reports"]["chat_id"], + chat_id=self.owner + if self.config["reports"]["chat_id"] == "owner" + else self.config["reports"]["chat_id"], text=f"Bot stopped with PID `{getpid()}`", ) await asyncio.sleep(0.5)