Layer 220
method Users
messages.toggleNoForwards#b11eafa2 peer:InputPeer enabled:Bool = Updates;

Parameters

Name Type Description
Peer InputPeer The chat or channel
Enabled Bool Enable or disable content protection

Returns

Updates

Possible Errors

Code Type Description
400 CHAT_ADMIN_REQUIRED You must be an admin in this chat to do this.
400 CHAT_NOT_MODIFIED No changes were made to chat information because the new information you passed is identical to the current information.
400 PEER_ID_INVALID The provided peer id is invalid.

Gogram Example

// MessagesToggleNoForwards - positional arguments
result, err := client.MessagesToggleNoForwards(&tg.InputPeerUser{UserID: int64(123456789)}, true)
if err != nil {
    // handle error
}
// result is *tg.Updates