channels.RestrictSponsoredMessages

class pyrogram.raw.functions.channels.RestrictSponsoredMessages

Disable ads on the specified channel, for all users.

Details:
  • Layer: 223

  • ID: 9AE91519

Parameters:
  • channel (InputChannel) – The channel.

  • restricted (bool) – Whether to disable or re-enable ads.

Returns:

Updates

TL Schema

channels.restrictSponsoredMessages#9ae91519
channel:InputChannel
restricted:Bool

= Updates

Parameter Tree

RestrictSponsoredMessages
├── channelInputChannel
│ ├── InputChannelEmpty
│ ├── InputChannel
│ │ ├── channel_idlong
│ │ └── access_hashlong
│ ├── peerInputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_idint
│ └── channel_idlong
└── restrictedBool

Example

await app.invoke(
    RestrictSponsoredMessages(
        channel=await app.resolve_channel(chat_id),
        restricted=True,
    )
)