From 19def1ed311b50097574baacdd3c637d1ad8d1b3 Mon Sep 17 00:00:00 2001 From: Egg Date: Wed, 24 May 2023 17:36:00 +0200 Subject: [PATCH] Revert "decrease telegram timeout, add sleep for ratelimit" This reverts commit c11c23d44ea88ead39c500f926ffbccc6cfd2616. --- active_bots/telegrambot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/active_bots/telegrambot.py b/active_bots/telegrambot.py index f9a3f94..7e5fc31 100644 --- a/active_bots/telegrambot.py +++ b/active_bots/telegrambot.py @@ -14,9 +14,9 @@ class TelegramBot(Bot): try: updates = tb.get_updates(offset=seen_tg + 1, allowed_updates="message", - timeout=5).wait() + timeout=15).wait() except TypeError: - updates = tb.get_updates(timeout=5).wait() + updates = tb.get_updates(timeout=15).wait() reports = [] if updates == None: return reports @@ -87,8 +87,8 @@ class TelegramBot(Bot): text = text[:4096 - 2] + " \N{Horizontal ellipsis}" try: for subscriber_id in user.get_telegram_subscribers(): - tb.send_message(subscriber_id, text).wait() sleep(0.5) + tb.send_message(subscriber_id, text).wait() except Exception: logger.error('Error telegramming: ' + user.get_city() + ': ' + str(report.id), exc_info=True)