Replaced owner_id with app.owner
This commit is contained in:
parent
0fea30ccfd
commit
3da8e9c074
@ -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,
|
||||
)
|
||||
|
@ -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")
|
||||
|
@ -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()
|
||||
|
Reference in New Issue
Block a user