From 3d669e6caf24534e544ffaa838eab43b9f988f4a Mon Sep 17 00:00:00 2001 From: b3yond Date: Sun, 7 Oct 2018 19:09:02 +0200 Subject: [PATCH] fixing #42 - excepting more Telegram error codes --- active_bots/telegrambot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/active_bots/telegrambot.py b/active_bots/telegrambot.py index e829f37..0bb2866 100644 --- a/active_bots/telegrambot.py +++ b/active_bots/telegrambot.py @@ -20,7 +20,11 @@ class TelegramBot(Bot): if updates == None: return reports for update in updates: - if update == 404: + # return when telegram returns an error code + if update in [303, 404, 420, 500]: + return reports + elif isinstance(update, int): + logger.error("Unknown Telegram error code: " + str(update)) return reports user.save_seen_tg(update.update_id) if update.message.text.lower() == "/start":