From 0cc47c5a5f57b92135131c9c88e63f73420b4abc Mon Sep 17 00:00:00 2001 From: Anson Biggs Date: Tue, 11 Apr 2023 06:51:18 -0600 Subject: [PATCH] some message types were causing an error and flooding the logs --- bot.py | 9 ++++++--- requirements.txt | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 31e2e52..d7b2469 100644 --- a/bot.py +++ b/bot.py @@ -156,9 +156,12 @@ def symbol_detect_image(update: Update, context: CallbackContext): Makes image captions into text then passes the `update` and `context` to symbol detect so that it can reply cashtags in image captions. """ - if update.message.caption: - update.message.text = update.message.caption - symbol_detect(update, context) + try: + if update.message.caption: + update.message.text = update.message.caption + symbol_detect(update, context) + except AttributeError: + return def symbol_detect(update: Update, context: CallbackContext): diff --git a/requirements.txt b/requirements.txt index 4057ec0..7e1cf9b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -python-telegram-bot==13.5 +python-telegram-bot==20 requests==2.25.1 pandas==2.0.0 schedule==1.0.0