Force fetch sender/chat if only min information was given

This commit is contained in:
Lonami Exo
2019-04-05 21:28:31 +04:00
parent 21a8a50ab9
commit 29b21209bf
2 changed files with 11 additions and 2 deletions

View File

@@ -29,7 +29,9 @@ class ChatGetter(abc.ABC):
Returns `chat`, but will make an API call to find the
chat unless it's already cached.
"""
if self._chat is None and await self.get_input_chat():
# See `get_sender` for information about 'min'.
if (self._chat is None or getattr(self._chat, 'min', None))\
and await self.get_input_chat():
try:
self._chat =\
await self._client.get_entity(self._input_chat)