Change the way in which updates are read and handled

This commit is contained in:
Lonami Exo
2017-05-29 20:41:03 +02:00
parent ae1dbc63da
commit ebe4232b32
2 changed files with 68 additions and 35 deletions

View File

@@ -169,8 +169,12 @@ class TelegramClient:
raise ValueError('You must be connected to invoke requests!')
try:
updates = []
self.sender.send(request)
self.sender.receive(request, timeout)
self.sender.receive(request, timeout, updates=updates)
for update in updates:
for handler in self.sender._on_update_handlers:
handler(update)
return request.result