Discussion groups

Groups can be associated to a channel as a discussion group, to allow users to discuss about posts.

boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;

channelFull#e13c3d20 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector<long> default_send_as:flags.29?Peer available_reactions:flags.30?Vector<string> = ChatFull;

messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;

---functions---

channels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;
channels.getGroupsForDiscussion#f5dad378 = messages.Chats;

A discussion group can be associated to a channel using channels.setDiscussionGroup.
The discussion group can be accessed in the client by clicking on the discuss button of the channel, or by accessing the comment section of a specific post; the discussion group ID is also present in the linked_chat_id field of the channelFull constructor.

All messages sent to the channel will also be sent to the linked group (with sender peer from_id equal to the peer of the linked channel); those messages will also be automatically pinned in the group.
The comment section of a particular post can be disabled by removing the channel post message from the discussion group.

Linking a discussion group

To obtain a list of admined supergroups that a channel admin can possibly associate to a channel, use channels.getGroupsForDiscussion.
Returned legacy group chats must be first upgraded to supergroups before they can be set as a discussion group.
Before linking a supergroup to a channel, access to the supergroup's old messages must also be enabled using channels.togglePreHistoryHidden.

To set a returned supergroup as a discussion group use channels.setDiscussionGroup.

Schema:

boolFalse#bc799737 = Bool;
boolTrue#997275b5 = Bool;

messages.chats#64ff9fd5 chats:Vector<Chat> = messages.Chats;

---functions---

channels.setDiscussionGroup#40582bb2 broadcast:InputChannel group:InputChannel = Bool;
channels.getGroupsForDiscussion#f5dad378 = messages.Chats;

channels.togglePreHistoryHidden#eabbb94c channel:InputChannel enabled:Bool = Updates;