电报论坛
电报Telegram 允许创建包含多个不同主题的论坛。
论坛
channel#fe685355 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true autotranslation:flags2.15?true broadcast_messages_allowed:flags2.16?true monoforum:flags2.17?true forum_tabs:flags2.19?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector<Username> stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long linked_monoforum_id:flags2.18?long = Chat; ---functions--- channels.createChannel#91006707 flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true forum:flags.5?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string ttl_period:flags.4?int = Updates; channels.toggleForum#3ff75734 channel:InputChannel enabled:Bool tabs:Bool = Updates;
论坛可以通过调用设置标志的channels.createChannel创建,或者通过channels.toggleForum将已有的超级群组转换为论坛创建。
如果群组是基础群组,应该先升级为超级群组,再转为论坛。forumenabled=true
论坛也可以使用 channels.toggleForum 转换回超级群组。enabled=false
请注意,channels.toggleForum 方法只能被拥有所有者权利的管理员调用。
论坛上有频道。标记已设置,讨论会在不同的论坛主题中进行。forum
论坛话题
forumTopic#71701da9 flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic; forumTopicDeleted#023f109b id:int = ForumTopic; messages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector<ForumTopic> messages:Vector<Message> chats:Vector<Chat> users:Vector<User> pts:int = messages.ForumTopics; inputStickerSetEmojiDefaultTopicIcons#44c1f8e9 = InputStickerSet; messageActionTopicCreate#0d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction; messageActionTopicEdit#c0944820 flags:# title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = MessageAction; updateChannelPinnedTopic#192efbe3 flags:# pinned:flags.0?true channel_id:long topic_id:int = Update; updateChannelPinnedTopics#fe198602 flags:# channel_id:long order:flags.0?Vector<int> = Update; inputReplyToMessage#869fbe10 flags:# reply_to_msg_id:int top_msg_id:flags.0?int reply_to_peer_id:flags.1?InputPeer quote_text:flags.2?string quote_entities:flags.3?Vector<MessageEntity> quote_offset:flags.4?int monoforum_peer_id:flags.5?InputPeer todo_item_id:flags.6?int = InputReplyTo; ---functions--- channels.getForumTopics#0de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics; channels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector<int> = messages.ForumTopics; channels.deleteTopicHistory#34435f2d channel:InputChannel top_msg_id:int = messages.AffectedHistory; channels.createForumTopic#f40c0224 flags:# channel:InputChannel title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates; channels.editForumTopic#f4dfa185 flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates; channels.updatePinnedForumTopic#6c2d9026 channel:InputChannel topic_id:int pinned:Bool = Updates; channels.reorderPinnedForumTopics#2950a18f flags:# force:flags.0?true channel:InputChannel order:Vector<int> = Updates; channels.toggleViewForumAsMessages#9738bb15 channel:InputChannel enabled:Bool = Updates;
论坛可以有多个话题,用户可以在那里互动。
要获取论坛的主题列表,请使用 channels.getForumTopics;同样的方法也可以用来按主题名称搜索。
要通过主题ID获取一个或多个主题的信息,请使用channels.getForumTopicsByID。
每个论坛都有一个不可删除的“通用”主题,且;其他主题则有其他ID,等于创建该主题的messageActionTopicCreate服务消息。id=1
要向“General”主题发送消息,只需像往常一样使用 messages.sendMessage,就像你在写给普通超级群一样。
另一方面,主题 是创建该主题的 messageActionTopicCreate 服务消息的消息线程。
这意味着客户端应将主题与消息线程类似地对待。
要向这些主题发送消息,将主题 ID 传递给 inputReplyToMessage 参数,调用 messages.sendMessage、messages.sendMedia 等时该参数。id != 1reply_to_msg_idreply_to
要回复主题内的消息,先将该消息的ID传递给inputReplyToMessage.,除非我们回复的是“General”主题中的消息,否则将主题ID传给inputReplyToMessage..
注意,回复主题中的消息时,输入ReplyToMessage。字段必须包含主题ID,当且仅当我们回复的论坛主题与“通用”主题不同(即 这样,如果回复消息在方法执行完成前被删除,该字段中的值将用于将消息发送到正确的主题,而不是“通用”主题。
还要注意,由于消息线程不能有嵌套的消息线程,主题(除了“通用”主题)也不能有消息线程(因此主题内的回复不会生成后续消息线程)。reply_to_msg_idtop_msg_idtop_msg_idreply_to_msg_idreply_to_msg_id != topicIDtopicID != 1
话题有名称()和图标:图标可以是自定义表情符号,如果未设置,则是默认聊天图标,填充中指定的颜色。
话题可以临时,防止向该话题发送更多消息。
此外,(仅)“通用”主题也可以是。除“通用”主题外
,所有主题都可以通过调用channels.deleteTopicHistory删除,并使用主题ID。titleicon_emoji_idicon_emoji_idicon_colorclosedhidden
话题可以通过 channels.createForumTopic 方法创建,也可以用 channels.editForumTopic 方法进行修改:这些操作需要manage_topics权利,并会生成 messageActionTopicCreate/messageActionTopicEdit 服务消息。
请注意,Telegram Premium 用户可以将任何自定义表情符号传递给 ,而其他用户只能使用 inputStickerSetEmojiDefaultTopicIcons 表情包中包含的自定义表情符号。
如果使用默认聊天图标,创建主题后其颜色无法更改。icon_emoji_id
话题可以通过 channels.updatePinnedForumTopic 进行置顶或取消置顶;使用 channels.reorderPinnedForumTopics 来重新排序置顶的主题。
根据客户端配置参数,你最多可以在每个论坛置顶主题。topics_pinned_limit
用户还可以选择将所有主题的消息显示为发送到普通群组的消息,使用本地客户端中的“作为消息查看”设置。
该设置仅影响当前账户,并通过 channels.toggleViewForumAsMessages 方法同步到其他已登录会话;调用此方法将更新 channelFull 或 dialog 标志的值,并发送 updateChannelViewForumAsMessages 文件。view_forum_as_messages
标签式或列表式论坛界面
channel#fe685355 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true autotranslation:flags2.15?true broadcast_messages_allowed:flags2.16?true monoforum:flags2.17?true forum_tabs:flags2.19?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector<Username> stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long send_paid_messages_stars:flags2.14?long linked_monoforum_id:flags2.18?long = Chat; ---functions--- channels.toggleForum#3ff75734 channel:InputChannel enabled:Bool tabs:Bool = Updates;
论坛可以根据频道的价值使用标签页或列表式的UI来选择主题。旗帜。forum_tabs
该标志可以通过 channels.toggleForum 切换,通过传递 和 来启用或禁用标签界面。enabled=truetabs=true|false
单一论坛
单一论坛是一种特殊类型的论坛,用于实现向频道发送的直接消息。
虽然在 API 中它们有时被称为“单一论坛”,但实际上它们与保存消息 API 有更多相似之处:详见此处 » 获取关于直信道消息的完整文档。