From e6ebd81928075d924b5eb6fd936047665264219f Mon Sep 17 00:00:00 2001 From: Anson Biggs Date: Fri, 21 May 2021 20:16:36 -0700 Subject: [PATCH] #56 added message when errors occur. --- bot.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/bot.py b/bot.py index ecfbd13..81a2e9a 100644 --- a/bot.py +++ b/bot.py @@ -466,19 +466,22 @@ def error(update: Update, context: CallbackContext): ) tb_string = "".join(tb_list) print(tb_string) - if update: - message = ( - f"An exception was raised while handling an update\n" - f"
update = {html.escape(json.dumps(update.to_dict(), indent=2, ensure_ascii=False))}"
-            "
\n\n" - f"
context.chat_data = {html.escape(str(context.chat_data))}
\n\n" - f"
context.user_data = {html.escape(str(context.user_data))}
\n\n" - f"
{html.escape(tb_string)}
" - ) + # if update: + # message = ( + # f"An exception was raised while handling an update\n" + # f"
update = {html.escape(json.dumps(update.to_dict(), indent=2, ensure_ascii=False))}"
+    #         "
\n\n" + # f"
context.chat_data = {html.escape(str(context.chat_data))}
\n\n" + # f"
context.user_data = {html.escape(str(context.user_data))}
\n\n" + # f"
{html.escape(tb_string)}
" + # ) + update.message.reply_text( + text="An error has occured. Please inform @MisterBiggs if the error persists." + ) - # Finally, send the message - # update.message.reply_text(text=message, parse_mode=telegram.ParseMode.HTML) - # update.message.reply_text(text="Please inform the bot admin of this issue.") + # Finally, send the message + # update.message.reply_text(text=message, parse_mode=telegram.ParseMode.HTML) + # update.message.reply_text(text="Please inform the bot admin of this issue.") def main():