Layer 224
method Users
messages.toggleNoForwards#b2081a35 flags:# peer:InputPeer enabled:Bool request_msg_id:flags.0?int = Updates;

Parameters

Name Type Description
Peer InputPeer The chat or channel
Enabled Bool Enable or disable content protection
RequestMsgId flags.0?int

Returns

Updates

Gogram Example

// MessagesToggleNoForwards - using Params struct
result, err := client.MessagesToggleNoForwards(&tg.MessagesToggleNoForwardsParams{
    Peer: &tg.InputPeerUser{UserID: int64(777000)},
    Enabled: true,

    // Optional fields:
    // RequestMsgId: 42,
})
if err != nil {
    // handle error
}
// result is *tg.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.