From 4f5f63b20fb97e902c5b2a2e9a973e0ed505d393 Mon Sep 17 00:00:00 2001 From: b3yond Date: Fri, 9 Aug 2019 14:35:01 +0200 Subject: [PATCH] logging telegram messages for debug purposes --- active_bots/telegrambot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/active_bots/telegrambot.py b/active_bots/telegrambot.py index 6b1fd5b..cce5304 100644 --- a/active_bots/telegrambot.py +++ b/active_bots/telegrambot.py @@ -23,6 +23,7 @@ class TelegramBot(Bot): # return when telegram returns an error code if update in [303, 404, 420, 500, 502]: return reports + # log unusual telegram error messages if isinstance(update, int): try: logger.error("City " + str(user.uid) + @@ -44,6 +45,7 @@ class TelegramBot(Bot): "We only support text reporting for privacy reasons. Can " "you describe it as text instead?") continue + logger.error("TG Message has Text attribute: " + update.message.text) if update.message.text.lower() == "/start": user.add_telegram_subscribers(update.message.sender.id) tb.send_message(