channels.toggleAntiSpam

Enable or disable the native antispam system.

 Method schema is available as of layer 150. Switch »

Parameters

Name Type Description
channel InputChannel 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 Enable or disable the native antispam system.

Result

Updates

Possible errors

Code Type Description
400 CHAT_NOT_MODIFIED No changes were made to chat information because the new information you passed is identical to the current information.

Bots can use this method

Related pages

Client configuration

The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.

Native antispam system

Admins of supergroups with a certain number of members can choose to unleash the full proactive power of Telegram's own antispam algorithms – turning on the new Aggressive mode for the automated spam filters.