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
| Name | Type | Required | Description |
|---|---|---|---|
Channel | InputChannelClass | yes | The forum |
Enabled | bool | yes | The new value of the view_forum_as_messages flag. |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHANNEL_INVALID | The provided channel is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
channels.toggleViewForumAsMessages#9738bb15