fixing #42 - excepting more Telegram error codes

master
b3yond 2018-10-07 19:09:02 +02:00
parent 9c0744c9d4
commit ce88e4976d
1 changed files with 5 additions and 1 deletions

View File

@ -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":