消息线程功能

Telegram 允许用户在频道帖子或通用超级群组消息上发表评论,这要归功于消息线程功能。

消息线程

模式:

messageReplyHeader#6917560b flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true quote:flags.9?true reply_to_msg_id:flags.4?int reply_to_peer_id:flags.0?Peer reply_from:flags.5?MessageFwdHeader reply_media:flags.8?MessageMedia reply_to_top_id:flags.1?int quote_text:flags.6?string quote_entities:flags.7?Vector<MessageEntity> quote_offset:flags.10?int todo_item_id:flags.11?int = MessageReplyHeader;messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;message#9815cec8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true noforwards:flags.26?true invert_media:flags.27?true flags2:# offline:flags2.1?true video_processing_pending:flags2.4?true paid_suggested_post_stars:flags2.8?true paid_suggested_post_ton:flags2.9?true id:int from_id:flags.8?Peer from_boosts_applied:flags.29?int peer_id:Peer saved_peer_id:flags.28?Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long via_business_bot_id:flags2.0?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long reactions:flags.20?MessageReactions restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int quick_reply_shortcut_id:flags.30?int effect:flags2.2?long factcheck:flags2.3?FactCheck report_delivery_until_date:flags2.5?int paid_message_stars:flags2.6?long suggested_post:flags2.7?SuggestedPost = Message;---functions---messages.search#29ee847a flags:# peer:InputPeer q:string from_id:flags.0?InputPeer saved_peer_id:flags.2?InputPeer saved_reaction:flags.3?Vector<Reaction> top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;

通常情况下,在回复群组中的任何消息时,系统会自动创建主题。
例如,对 ID 为 的消息的所有回复420都会关联到 ID 为 的主题,该主题在此群组中是唯一的;此主题 ID以及主题回复头中的 字段420包含在messageReplyHeaderreply_to_top_id字段中(如果主题中包含回复,则可能包含 )。对同一主题中消息的回复属于同一主题,不会创建新主题。reply_toreply_to_msg_id

当收到来自某个群组且也是某个主题顶部的消息420(ID 为 的消息)时,replies可选字段将包含一个messageReplies构造函数,其中包含主题中最新回复的消息 ID 和PTS,以及最新已读主题回复的消息 ID,以及主题中的回复总数。

也可以使用messages.search手动获取帖子回复,并提供top_msg_id帖子 ID。

频道评论

上面看到的相同messageReplies构造函数也将包含在频道帖子中,这次包含有关特定频道帖子评论部分的信息,请参阅此处 »了解更多信息。