From aebe48527c1ec74a2db5dda2d69aa991fe6f6df6 Mon Sep 17 00:00:00 2001 From: Lonami Date: Thu, 15 Jun 2017 17:12:20 +0200 Subject: [PATCH] Let get_input_peer do its magic --- Forwarding-messages.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Forwarding-messages.md b/Forwarding-messages.md index 8f947bb..e4488dd 100644 --- a/Forwarding-messages.md +++ b/Forwarding-messages.md @@ -3,9 +3,6 @@ For some reason, [`ForwardMessageRequest`](https://lonamiwebs.github.io/Telethon You should use [`ForwardMessagesRequest`](https://lonamiwebs.github.io/Telethon/methods/messages/forward_messages.html) (note it's _Message**s**_, plural) as follows: ```python -from telethon.utils import generate_random_long -from telethon.helpers import get_input_peer - messages = foo() # Logic to retrieve a few messages. from_entity = bar() # Who has the original messages. to_entity = baz() # Who you want to forward them to. @@ -13,8 +10,7 @@ to_entity = baz() # Who you want to forward them to. client.invoke(ForwardMessagesRequest( from_peer=get_input_peer(from_entity), id=[msg.id for msg in messages], - random_id=[generate_random_long() for _ in range(len(messages))], - to_peer=get_input_peer(to_entity) + to_peer=to_entity )) ```