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