Skip to main content

messages.toggleNoForwards

Enable or disable content protection on a channel, group or private chat.

func (c *Client) MessagesToggleNoForwards(ctx context.Context, request *MessagesToggleNoForwardsRequest) (UpdatesClass, error)

Calling this method

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

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

Parameters

NameTypeRequiredDescription
PeerInputPeerClassyesThe chat or channel
EnabledboolEnable or disable content protection
RequestMsgIDintUsed only inside private chats to accept or refuse a request to disable content protection, see here » for more info on the full flow.

Returns

UpdatesClass

Possible errors

CodeTypeDescription
400CHAT_ADMIN_REQUIREDYou must be an admin in this chat to do this.
400CHAT_NOT_MODIFIEDNo changes were made to chat information because the new information you passed is identical to the current information.
400PEER_ID_INVALIDThe provided peer id is invalid.

References