There is api method messages.getReplies in Telegram API and the equivalent of the same is functions.messages.GetRepliesRequest in the Telethon. But this method is not returning the expected replies/comments to the post. Instead, it returns multiple messages including the replies to the requested message_id and other messages also which are not even the replies to the requested message_id.
for conv in client.iter_messages(channel.id):
if conv.reply_to:
# get parent message this message reply to
original_message = conv.get_reply_message()
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 ***************')
Here it returns the replies to the input message.id in the argument reply_to
including the messages which are not the replies to the input message.id.
(I checked the response from of the method call(inner for loop) and their reply_to_msg_id
differs from what i requested to get the result).
I could not understand the behaviour of these replies getting in the result.
Also Telegram API docs are not good in shape with example and explantion.
- What and how messages are considered as
reply
to the message in the telegram? - How telegram decides upon the messages whether it is a reply or a normal message?
- if a message is reply, then to which message this is a reply?