如何通过电视马拉松从链接的频道讨论组获取消息
我已经成功从频道检索消息。 我用 iter_messages 函数来做到这一点 但是,消息对象不包含评论,只有用户写的评论。 对象中有一个channel_id,这似乎是链接的组。但该群组没有像 t.me/xxx 这样的 URL。有人有解决办法吗?
以下是 JSON 对象的摘录。
"replies": {
"_": "MessageReplies",
"replies": 8,
"replies_pts": 17846,
"comments": true,
"recent_repliers": [
{
"_": "PeerUser",
"user_id": 57135752
},
{
"_": "PeerUser",
"user_id": 564589817
},
{
"_": "PeerUser",
"user_id": 888542547
}
],
"channel_id": 1484030956,
"max_id": 13402,
"read_max_id": null
},
I have already successfully retrieved messages from channels.
I do that with the iter_messages function
However, the message object does not contain the comments, only the users wrote the comments.
In the object is a channel_id, this seems to be the linked group. But the group doesn't have a URL like t.me/xxx. Does anyone have an approach for a solution?
Here is an excerpt from the object as JSON.
"replies": {
"_": "MessageReplies",
"replies": 8,
"replies_pts": 17846,
"comments": true,
"recent_repliers": [
{
"_": "PeerUser",
"user_id": 57135752
},
{
"_": "PeerUser",
"user_id": 564589817
},
{
"_": "PeerUser",
"user_id": 888542547
}
],
"channel_id": 1484030956,
"max_id": 13402,
"read_max_id": null
},
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您手动加入该组,则可以使用。
但更好的方法是获取完整的频道请求,这样您就可以获取频道本身并作为实体进行聊天(也许可以加入它?),然后查找其中是否有对频道帖子的回复。
该代码未经测试,但我正在研究它 o_0
If you had joined to this group manually, It can work.
But better way is to get full channel request, so you can get a channel itself and chat as an entities (and maybe join it?), then find if any of them are replies to channel post.
This code is untested, but I am working on it o_0
最后,我找到了一个工作正常的解决方案。
当您具有特定消息ID时,您可以设置标志Reply_to。然后,您将获得频道帖子的评论。
Finally i found a solution which is working fine.
When you have the specific message id you can set the flag reply_to. Then you get the comments of the channel posts.