admin管理员组文章数量:1025311
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
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
本文标签:
版权声明:本文标题:How to determine if a message on Telegram is a comment using pyrogram? (or any other library if not possible with pyrogram) - St 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745618257a2159421.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论