From 1486c7964577124a9cfffb4fb7fd3adb36aae472 Mon Sep 17 00:00:00 2001 From: Egg Date: Tue, 21 Feb 2023 10:16:21 +0100 Subject: [PATCH] telegrambot: add a polling timeout aka wait for a while --- active_bots/telegrambot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/active_bots/telegrambot.py b/active_bots/telegrambot.py index 31f7675..401b8a6 100644 --- a/active_bots/telegrambot.py +++ b/active_bots/telegrambot.py @@ -13,9 +13,10 @@ class TelegramBot(Bot): seen_tg = user.get_seen_tg() try: updates = tb.get_updates(offset=seen_tg + 1, - allowed_updates="message").wait() + allowed_updates="message", + timeout=15).wait() except TypeError: - updates = tb.get_updates().wait() + updates = tb.get_updates(timeout=15).wait() reports = [] if updates == None: return reports