channels.toggleAntiSpam
Enable or disable the native antispam system.
func (c *Client) ChannelsToggleAntiSpam(ctx context.Context, request *ChannelsToggleAntiSpamRequest) (UpdatesClass, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.ChannelsToggleAntiSpam(ctx, &tg.ChannelsToggleAntiSpamRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // UpdatesClass
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Channel | InputChannelClass | yes | Supergroup ID. The specified supergroup must have at least telegram_antispam_group_size_min members to enable antispam functionality, as specified by the client configuration parameters. |
Enabled | bool | yes | Enable or disable the native antispam system. |
Returns
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | CHANNEL_INVALID | The provided channel is invalid. |
| 400 | CHAT_NOT_MODIFIED | No changes were made to chat information because the new information you passed is identical to the current information. |
References
- Official documentation
- Generated Go reference
- TL definition:
channels.toggleAntiSpam#68f3e4eb