From 3da8e9c07406f898dc2bf65c11f9e5c793f3b765 Mon Sep 17 00:00:00 2001 From: profitroll Date: Fri, 14 Jul 2023 12:42:47 +0200 Subject: [PATCH] Replaced owner_id with app.owner --- modules/bwt.py | 2 +- plugins/balance.py | 4 ++-- plugins/shutdown.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/bwt.py b/modules/bwt.py index be3d377..a0b27b7 100644 --- a/modules/bwt.py +++ b/modules/bwt.py @@ -84,7 +84,7 @@ async def getWaterLeft(cardid, filename, app=None): if app != None: await app.send_message( - await config_get("owner_id"), + app.owner, f"**Exception occured:**\n • User: `{str(filename)}`\n • Card: [{cardid}]({url})\n • Exception: `{exp}`\n • TMP UUID: `{tmp_name}`\n • Traceback: `{format_exc()}`", disable_web_page_preview=True, ) diff --git a/plugins/balance.py b/plugins/balance.py index b7fd4a6..2ba82c2 100644 --- a/plugins/balance.py +++ b/plugins/balance.py @@ -52,12 +52,12 @@ async def command_balance(app: Client, msg: Message): f"User {str(msg.from_user.id)} tried to get balance without card set" ) except Exception as exp: - if msg.from_user.id != await config_get("owner_id"): + if msg.from_user.id != app.owner: await msg.reply_text( (await string("error_occured")).format(await string("get_number")) ) await app.send_message( - await config_get("owner_id"), + app.owner, f"Error occured by {str(msg.from_user.id)}:\nException: `{exp}`\nTraceback: `{format_exc()}`", ) logger.warning(f"User {str(msg.from_user.id)} could not get left water amount") diff --git a/plugins/shutdown.py b/plugins/shutdown.py index c952853..595b7bb 100644 --- a/plugins/shutdown.py +++ b/plugins/shutdown.py @@ -15,7 +15,7 @@ logger = logging.getLogger(__name__) ~filters.scheduled & filters.command(["kill", "die", "shutdown"], prefixes="/") # type: ignore ) async def command_shutdown(app: Client, msg: Message): - if msg.from_user.id == await config_get("owner_id"): + if msg.from_user.id == app.owner: await msg.reply_text(f"Shutting down bot with pid **{getpid()}**") logger.info(f"Shutting down as requested by {msg.from_user.id}") exit()