reports.chat_id can now be "owner"

This commit is contained in:
Profitroll 2023-07-03 10:56:24 +02:00
parent ae374511cd
commit 279a8e9d84
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2

View File

@ -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)