Skip to main content

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

NameTypeRequiredDescription
ChannelInputChannelClassyesSupergroup 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.
EnabledboolyesEnable or disable the native antispam system.

Returns

UpdatesClass

Possible errors

CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.
400CHAT_NOT_MODIFIEDNo changes were made to chat information because the new information you passed is identical to the current information.

References