mirror of
https://gitlab.com/simple-stock-bots/simple-telegram-stock-bot.git
synced 2025-06-16 15:06:53 +00:00
#56 added message when errors occur.
This commit is contained in:
parent
15a62b7989
commit
e6ebd81928
27
bot.py
27
bot.py
@ -466,19 +466,22 @@ def error(update: Update, context: CallbackContext):
|
|||||||
)
|
)
|
||||||
tb_string = "".join(tb_list)
|
tb_string = "".join(tb_list)
|
||||||
print(tb_string)
|
print(tb_string)
|
||||||
if update:
|
# if update:
|
||||||
message = (
|
# message = (
|
||||||
f"An exception was raised while handling an update\n"
|
# f"An exception was raised while handling an update\n"
|
||||||
f"<pre>update = {html.escape(json.dumps(update.to_dict(), indent=2, ensure_ascii=False))}"
|
# f"<pre>update = {html.escape(json.dumps(update.to_dict(), indent=2, ensure_ascii=False))}"
|
||||||
"</pre>\n\n"
|
# "</pre>\n\n"
|
||||||
f"<pre>context.chat_data = {html.escape(str(context.chat_data))}</pre>\n\n"
|
# f"<pre>context.chat_data = {html.escape(str(context.chat_data))}</pre>\n\n"
|
||||||
f"<pre>context.user_data = {html.escape(str(context.user_data))}</pre>\n\n"
|
# f"<pre>context.user_data = {html.escape(str(context.user_data))}</pre>\n\n"
|
||||||
f"<pre>{html.escape(tb_string)}</pre>"
|
# f"<pre>{html.escape(tb_string)}</pre>"
|
||||||
)
|
# )
|
||||||
|
update.message.reply_text(
|
||||||
|
text="An error has occured. Please inform @MisterBiggs if the error persists."
|
||||||
|
)
|
||||||
|
|
||||||
# Finally, send the message
|
# Finally, send the message
|
||||||
# update.message.reply_text(text=message, parse_mode=telegram.ParseMode.HTML)
|
# update.message.reply_text(text=message, parse_mode=telegram.ParseMode.HTML)
|
||||||
# update.message.reply_text(text="Please inform the bot admin of this issue.")
|
# update.message.reply_text(text="Please inform the bot admin of this issue.")
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user