mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 01:16:35 +03:00
Support Message without client as inputs to forward_messages
Raw API does not monkey-patch the client on the returned messages, so the get_input_chat call would return None, causing the forward to fail. Instead, manually resolve the chat using the message's peer_id. The resolve call can also be avoided if from_peer is passed (which may mismatch with where the messages actually belong, but that's not really a concern).
This commit is contained in:
parent
610b8c34dd
commit
acfde7132b
|
@ -1018,7 +1018,7 @@ class MessageMethods:
|
||||||
if isinstance(chunk[0], int):
|
if isinstance(chunk[0], int):
|
||||||
chat = from_peer
|
chat = from_peer
|
||||||
else:
|
else:
|
||||||
chat = await chunk[0].get_input_chat()
|
chat = from_peer or await self.get_input_entity(chunk[0].peer_id)
|
||||||
chunk = [m.id for m in chunk]
|
chunk = [m.id for m in chunk]
|
||||||
|
|
||||||
req = functions.messages.ForwardMessagesRequest(
|
req = functions.messages.ForwardMessagesRequest(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user