Replaced owner_id with app.owner

This commit is contained in:
Profitroll 2023-07-14 12:42:47 +02:00
parent 0fea30ccfd
commit 3da8e9c074
Signed by: profitroll
GPG Key ID: FA35CAB49DACD3B2
3 changed files with 4 additions and 4 deletions

View File

@ -84,7 +84,7 @@ async def getWaterLeft(cardid, filename, app=None):
if app != None: if app != None:
await app.send_message( 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()}`", 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, disable_web_page_preview=True,
) )

View File

@ -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" f"User {str(msg.from_user.id)} tried to get balance without card set"
) )
except Exception as exp: 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 msg.reply_text(
(await string("error_occured")).format(await string("get_number")) (await string("error_occured")).format(await string("get_number"))
) )
await app.send_message( 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()}`", 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") logger.warning(f"User {str(msg.from_user.id)} could not get left water amount")

View File

@ -15,7 +15,7 @@ logger = logging.getLogger(__name__)
~filters.scheduled & filters.command(["kill", "die", "shutdown"], prefixes="/") # type: ignore ~filters.scheduled & filters.command(["kill", "die", "shutdown"], prefixes="/") # type: ignore
) )
async def command_shutdown(app: Client, msg: Message): 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()}**") await msg.reply_text(f"Shutting down bot with pid **{getpid()}**")
logger.info(f"Shutting down as requested by {msg.from_user.id}") logger.info(f"Shutting down as requested by {msg.from_user.id}")
exit() exit()