messages.ToggleNoForwards

class pyrogram.raw.functions.messages.ToggleNoForwards

Enable or disable content protection on a channel or chat

Details:
  • Layer: 223

  • ID: B2081A35

Parameters:
  • peer (InputPeer) – The chat or channel

  • enabled (bool) – Enable or disable content protection

  • request_msg_id (int 32-bit, optional) – N/A

Returns:

Updates

TL Schema

messages.toggleNoForwards#b2081a35
flags:#
peer:InputPeer
enabled:Bool
request_msg_id:flags.0?int

= Updates

Parameter Tree

ToggleNoForwards
├── peerInputPeer
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_idlong
│ ├── InputPeerUser
│ │ ├── user_idlong
│ │ └── access_hashlong
│ ├── InputPeerChannel
│ │ ├── channel_idlong
│ │ └── access_hashlong
│ │ ├── peerInputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_idint
│ │ └── user_idlong
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── channel_idlong
├── enabledBool
└── request_msg_idint (optional)

Example

await app.invoke(
    ToggleNoForwards(
        peer=await app.resolve_peer(chat_id),
        enabled=True,
        request_msg_id=0,
    )
)