mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Fix TypeError when accessing unexisting sender
This commit is contained in:
parent
d6818f25f5
commit
8d5c052fce
|
@ -167,10 +167,10 @@ class Message:
|
|||
|
||||
`input_sender` needs to be available (often the case).
|
||||
"""
|
||||
if self._sender is None:
|
||||
if self._sender is None and await self.input_sender:
|
||||
try:
|
||||
self._sender =\
|
||||
await self._client.get_entity(await self.input_sender)
|
||||
await self._client.get_entity(self._input_sender)
|
||||
except ValueError:
|
||||
await self._reload_message()
|
||||
return self._sender
|
||||
|
@ -183,10 +183,10 @@ class Message:
|
|||
to get the most up to date version of the chat (mostly when the event
|
||||
doesn't belong to a channel), so keep that in mind.
|
||||
"""
|
||||
if self._chat is None:
|
||||
if self._chat is None and await self.input_chat:
|
||||
try:
|
||||
self._chat =\
|
||||
await self._client.get_entity(await self.input_chat)
|
||||
await self._client.get_entity(self._input_chat)
|
||||
except ValueError:
|
||||
await self._reload_message()
|
||||
return self._chat
|
||||
|
|
Loading…
Reference in New Issue
Block a user