telegrambot: add a polling timeout aka wait for a while
parent
d698bb2ed0
commit
1486c79645
|
@ -13,9 +13,10 @@ class TelegramBot(Bot):
|
||||||
seen_tg = user.get_seen_tg()
|
seen_tg = user.get_seen_tg()
|
||||||
try:
|
try:
|
||||||
updates = tb.get_updates(offset=seen_tg + 1,
|
updates = tb.get_updates(offset=seen_tg + 1,
|
||||||
allowed_updates="message").wait()
|
allowed_updates="message",
|
||||||
|
timeout=15).wait()
|
||||||
except TypeError:
|
except TypeError:
|
||||||
updates = tb.get_updates().wait()
|
updates = tb.get_updates(timeout=15).wait()
|
||||||
reports = []
|
reports = []
|
||||||
if updates == None:
|
if updates == None:
|
||||||
return reports
|
return reports
|
||||||
|
|
Loading…
Reference in New Issue