mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-13 04:56:35 +03:00
Fix-up 53fbfb2
for InputPeerChat or others
This commit is contained in:
parent
53fbfb215f
commit
43afdb9d77
|
@ -37,8 +37,7 @@ class Message:
|
||||||
self._sender = entities.get(self.original_message.from_id)
|
self._sender = entities.get(self.original_message.from_id)
|
||||||
if self._sender:
|
if self._sender:
|
||||||
self._input_sender = get_input_peer(self._sender)
|
self._input_sender = get_input_peer(self._sender)
|
||||||
if (isinstance(self._input_sender, types.InputPeerUser)
|
if not getattr(self._input_sender, 'access_hash', None):
|
||||||
and not self._input_sender.access_hash):
|
|
||||||
self._input_sender = None
|
self._input_sender = None
|
||||||
else:
|
else:
|
||||||
self._input_sender = None
|
self._input_sender = None
|
||||||
|
@ -55,7 +54,7 @@ class Message:
|
||||||
self._input_chat = input_chat
|
self._input_chat = input_chat
|
||||||
if not self._input_chat and self._chat:
|
if not self._input_chat and self._chat:
|
||||||
self._input_chat = get_input_peer(self._chat)
|
self._input_chat = get_input_peer(self._chat)
|
||||||
if not self._input_chat.access_hash:
|
if not getattr(self._input_sender, 'access_hash', None):
|
||||||
# Telegram may omit the hash in updates -> invalid peer
|
# Telegram may omit the hash in updates -> invalid peer
|
||||||
self._input_chat = None
|
self._input_chat = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user