AttributeError handling in get_submission

This commit is contained in:
Profitroll 2022-08-22 11:51:40 +02:00
parent 404a46ec15
commit aca61b8c1a

View File

@ -221,6 +221,7 @@ def subUnblock(user):
@app.on_message(~ filters.scheduled & filters.photo | filters.video | filters.animation | filters.document) @app.on_message(~ filters.scheduled & filters.photo | filters.video | filters.animation | filters.document)
def get_submission(_, msg): def get_submission(_, msg):
try:
if msg.from_user.id not in jsonLoad(configGet("blocked", "locations")): if msg.from_user.id not in jsonLoad(configGet("blocked", "locations")):
user_locale = msg.from_user.language_code user_locale = msg.from_user.language_code
if not subLimited(msg.from_user): if not subLimited(msg.from_user):
@ -286,6 +287,8 @@ def get_submission(_, msg):
else: else:
msg.reply_text(locale("sub_cooldown", "message", locale=user_locale).format(str(configGet("timeout", "submission")))) msg.reply_text(locale("sub_cooldown", "message", locale=user_locale).format(str(configGet("timeout", "submission"))))
except AttributeError:
logWrite(f"from_user in function get_submission does not seem to contain id")
@app.on_callback_query(filters.regex("sub_yes_[\s\S]*_[\s\S]*")) # type: ignore @app.on_callback_query(filters.regex("sub_yes_[\s\S]*_[\s\S]*")) # type: ignore
def callback_query_yes(app, clb): # type: ignore def callback_query_yes(app, clb): # type: ignore