channels.toggleForum
Enable or disable forum functionality in a supergroup.
func (c *Client) ChannelsToggleForum(ctx context.Context, request *ChannelsToggleForumRequest) (UpdatesClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.ChannelsToggleForum(ctx, &tg.ChannelsToggleForumRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Channel | InputChannelClass | yes | Supergroup ID |
Enabled | bool | yes | Enable or disable forum functionality |
Tabs | bool | yes | If true enables the tabbed forum UI, otherwise enables the list-based forum UI. |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHANNEL_INVALID | The provided channel is invalid. |
| 400 | CHAT_ADMIN_REQUIRED | You must be an admin in this chat to do this. |
| 400 | CHAT_DISCUSSION_UNALLOWED | You can't enable forum topics in a discussion group linked to a channel. |
| 400 | CHAT_ID_INVALID | The provided chat id is invalid. |
| 400 | CHAT_NOT_MODIFIED | No changes were made to chat information because the new information you passed is identical to the current information. |
References
- Official documentation
- Generated Go reference
- TL definition:
channels.toggleForum#3ff75734