mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Update __init__.py
This commit is contained in:
parent
010df3ed71
commit
78c2be4bd8
@ -105,10 +105,11 @@ class TeleBot:
|
|||||||
"""
|
"""
|
||||||
updates = apihelper.get_updates(self.token, offset=(self.last_update_id + 1), timeout=20)
|
updates = apihelper.get_updates(self.token, offset=(self.last_update_id + 1), timeout=20)
|
||||||
new_messages = []
|
new_messages = []
|
||||||
self.last_update_id = updates[-1]['update_id']
|
if updates:
|
||||||
for update in updates:
|
self.last_update_id = updates[-1]['update_id']
|
||||||
msg = types.Message.de_json(update['message'])
|
for update in updates:
|
||||||
new_messages.append(msg)
|
msg = types.Message.de_json(update['message'])
|
||||||
|
new_messages.append(msg)
|
||||||
|
|
||||||
if len(new_messages) > 0:
|
if len(new_messages) > 0:
|
||||||
self.process_new_messages(new_messages)
|
self.process_new_messages(new_messages)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user