Reuse code for _get_entity_pair

Less error-prone, improved the function flow for all callers,
and removed some duplicate work.
This commit is contained in:
Lonami Exo
2019-05-01 17:52:32 +02:00
parent 6d004601d0
commit 3a1496c205
9 changed files with 46 additions and 64 deletions

View File

@@ -105,7 +105,8 @@ class CallbackQuery(EventBuilder):
def _set_client(self, client):
super()._set_client(client)
self._sender, self._input_sender = self._get_entity_pair(self.sender_id)
self._sender, self._input_sender = utils._get_entity_pair(
self.sender_id, self._entities, client._entity_cache)
@property
def id(self):