Skip to main content

channels.toggleViewForumAsMessages

Users may also choose to display messages from all topics of a forum as if they were sent to a normal group, using a "View as messages" setting in the local client: this setting only affects the current account, and is synced to other logged in sessions using this method. Invoking this method will update the value of the view_forum_as_messages flag of channelFull or dialog and emit an updateChannelViewForumAsMessages.

func (c *Client) ChannelsToggleViewForumAsMessages(ctx context.Context, request *ChannelsToggleViewForumAsMessagesRequest) (UpdatesClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.ChannelsToggleViewForumAsMessages(ctx, &tg.ChannelsToggleViewForumAsMessagesRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})

Parameters

NameTypeRequiredDescription
ChannelInputChannelClassyesThe forum
EnabledboolyesThe new value of the view_forum_as_messages flag.

Returns

UpdatesClass

Possible errors

CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.

References