mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Process entities from sent requests/updates
This commit is contained in:
parent
fbf3bf119c
commit
262018959f
|
@ -160,6 +160,7 @@ class UpdateMethods(UserMethods):
|
|||
# region Private methods
|
||||
|
||||
def _handle_update(self, update):
|
||||
self.session.process_entities(update)
|
||||
if isinstance(update, (types.Updates, types.UpdatesCombined)):
|
||||
entities = {utils.get_peer_id(x): x for x in
|
||||
itertools.chain(update.users, update.chats)}
|
||||
|
|
|
@ -25,10 +25,14 @@ class UserMethods(TelegramBaseClient):
|
|||
if isinstance(future, list):
|
||||
results = []
|
||||
for f in future:
|
||||
results.append(await f)
|
||||
result = await f
|
||||
self.session.process_entities(result)
|
||||
results.append(result)
|
||||
return results
|
||||
else:
|
||||
return await future
|
||||
result = await future
|
||||
self.session.process_entities(result)
|
||||
return result
|
||||
except (errors.ServerError, errors.RpcCallFailError) as e:
|
||||
__log__.warning('Telegram is having internal issues %s: %s',
|
||||
e.__class__.__name__, e)
|
||||
|
|
Loading…
Reference in New Issue
Block a user