Skip to main content

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

NameTypeRequiredDescription
ChannelInputChannelClassyesSupergroup ID
EnabledboolyesEnable or disable forum functionality
TabsboolyesIf true enables the tabbed forum UI, otherwise enables the list-based forum UI.

Returns

UpdatesClass

Possible errors

CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400CHAT_DISCUSSION_UNALLOWEDYou can't enable forum topics in a discussion group linked to a channel.
400CHAT_ID_INVALIDThe provided chat id is invalid.
400CHAT_NOT_MODIFIEDNo changes were made to chat information because the new information you passed is identical to the current information.

References