mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 03:22:29 +00:00
Use the new in-memory entity cache
This should avoid a disk access every time an input entity is needed, which is very often. Another step for #1141.
This commit is contained in:
@@ -156,10 +156,8 @@ class CallbackQuery(EventBuilder):
|
||||
if not getattr(self._input_sender, 'access_hash', True):
|
||||
# getattr with True to handle the InputPeerSelf() case
|
||||
try:
|
||||
self._input_sender = self._client.session.get_input_entity(
|
||||
self._sender_id
|
||||
)
|
||||
except ValueError:
|
||||
self._input_sender = self._client._entity_cache[self._sender_id]
|
||||
except KeyError:
|
||||
m = await self.get_message()
|
||||
if m:
|
||||
self._sender = m._sender
|
||||
|
Reference in New Issue
Block a user