channels.restrictSponsoredMessages
Disable ads on the specified channel, for all users. Available only after reaching at least the boost level » specified in the channel_restrict_sponsored_level_min » config parameter.
func (c *Client) ChannelsRestrictSponsoredMessages(ctx context.Context, request *ChannelsRestrictSponsoredMessagesRequest) (UpdatesClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.ChannelsRestrictSponsoredMessages(ctx, &tg.ChannelsRestrictSponsoredMessagesRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Channel | InputChannelClass | yes | The channel. |
Restricted | bool | yes | Whether to disable or re-enable ads. |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHANNEL_INVALID | The provided channel is invalid. |
References
- Official documentation
- Generated Go reference
- TL definition:
channels.restrictSponsoredMessages#9ae91519