How to determine if a message on Telegram is a comment using pyrogram? (or any other library if not possible with pyrogram) - St

I need to differentiate between messages that are replies to a channel and comments under a channel pos

I need to differentiate between messages that are replies to a channel and comments under a channel post. I could not find any reliable way to do that and pyrogram does not give any info about whether a message is a comment or not in the Message object. Is there a way to do that? What's the exact difference between a comment and a reply to a channel's message?

I tried marking all replies to a message sent by a channel to be a comment, but a channel can send a message in a non-linked chat and when you reply to that message, it is not actually a comment.

reply_in_msg = msg.reply_to_message
is_reply_to_channel = reply_in_msg and (reply_in_msg.forward_from_chat and reply_in_msg.forward_from_chat.type == ChatType.CHANNEL)

The code block is mostly irrelevant, its what i use to determine whether a message contains a reply to a channel

What i expect: i need a way to determine whether a message is a comment or not and i have no idea how to do that

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745618258a4636366.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信