channels.setDiscussionGroup
Associate a group to a channel as discussion group for that channel
func (c *Client) ChannelsSetDiscussionGroup(ctx context.Context, request *ChannelsSetDiscussionGroupRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.ChannelsSetDiscussionGroup(ctx, &tg.ChannelsSetDiscussionGroupRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Broadcast | InputChannelClass | yes | Channel |
Group | InputChannelClass | yes | Discussion group to associate to the channel |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | BROADCAST_ID_INVALID | Broadcast ID invalid. |
| 400 | CHANNEL_INVALID | The provided channel is invalid. |
| 400 | CHAT_ADMIN_REQUIRED | You must be an admin in this chat to do this. |
| 403 | CHAT_WRITE_FORBIDDEN | You can't write in this chat. |
| 400 | LINK_NOT_MODIFIED | Discussion link not modified. |
| 400 | MEGAGROUP_ID_INVALID | Invalid supergroup ID. |
| 400 | MEGAGROUP_PREHISTORY_HIDDEN | Group with hidden history for new members can't be set as discussion groups. |
References
- Official documentation
- Generated Go reference
- TL definition:
channels.setDiscussionGroup#40582bb2