1
0
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:
4yBa4oK 2015-07-19 19:51:06 +03:00
parent f183575d10
commit 010df3ed71

View File

@ -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)