Telethon
Telethon copied to clipboard
How to `reply_to` works in `iter_messages()`
for conv in client.iter_messages(channel.id):
if conv.reply_to:
original_message = conv.get_reply_message() # get parent message this message reply to
try:
# iterate all the replies for the parent message
for reply in client.iter_messages(channel.id, reply_to=original_message.id):
print('\tReply message -> ', reply.to_dict())
except telethon.errors.rpcerrorlist.MsgIdInvalidError:
print('exception ***************')
This is not behaving as expected. When I look at the replies messages from for reply in client.iter_messages().....
,
the replies are having different reply_to_msg_id
than id
of original_message. While the method is expected to
return only the messages/comments which are replies to the original_messages.
The method is returning which are not even the replies to the original message. I found this by looking at reply_to_msg_id
of the replies.
Have you tried to check if the replies that were returned were not connected to the replies to messages that reply to the requested message?
something like this:
└── requested-message
├── reply-1
│ ├── reply-1
│ └── reply-2
│ └── reply-1
├── reply-2
└── reply-3
reply_to
is intended to show the "replies to" a broadcast message in its linked discussion group. That is, the comments of a post in a broadcast channel. Is that working as intended?
Replied in the StackOverflow post. Closing since there's no bug.