mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 17:36:34 +03:00
Set _input_chat on custom.Message creation/fixup input_chat
This commit is contained in:
parent
091b03c635
commit
24d2074e0c
|
@ -127,7 +127,8 @@ class EventCommon(abc.ABC):
|
|||
except ValueError:
|
||||
ch = isinstance(self._chat_peer, types.PeerChannel)
|
||||
if not ch and self._message_id is not None:
|
||||
msg = await self._client.get_messages(ids=self._message_id)
|
||||
msg = await self._client.get_messages(
|
||||
None, ids=self._message_id)
|
||||
self._chat = msg._chat
|
||||
self._input_chat = msg._input_chat
|
||||
else:
|
||||
|
|
|
@ -37,7 +37,11 @@ class Message:
|
|||
self._input_sender = get_input_peer(self._sender)
|
||||
else:
|
||||
self._input_sender = None
|
||||
|
||||
self._input_chat = input_chat
|
||||
if not self._input_chat and self._chat:
|
||||
self._input_chat = get_input_peer(self._chat)
|
||||
|
||||
self._fwd_from_entity = None
|
||||
if getattr(self.original_message, 'fwd_from', None):
|
||||
fwd = self.original_message.fwd_from
|
||||
|
|
Loading…
Reference in New Issue
Block a user