Layer 227
MessagesToggleNoForwards
Enable or disable content protection on a channel, group or private chat.
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 | Used only inside private chats to accept or refuse a request to disable content protection, see here for more info on the full flow. |
Returns
UpdatesGogram Example
// MessagesToggleNoForwards - positional arguments result, err := client.MessagesToggleNoForwards(&tg.InputPeerUser{UserID: int64(777000)}, true, nil) 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. |
| 400 | REQUEST_MSG_EXPIRED | The request specified in request_msg_id has already expired. |