AutoModerationRule

export class AutoModerationRule extends Base
export class AutoModerationRule extends Base
Represents an auto moderation rule.

Extends

Base
The actions of this auto moderation rule.
Readonly
client:Client<true>
The client that instantiated this
Inherited from Base
creatorId:Snowflake
The user that created this auto moderation rule.
enabled:boolean
Whether this auto moderation rule is enabled.
The event type of this auto moderation rule.
The channels exempt by this auto moderation rule.
exemptRoles:Collection<Snowflake, Role>
The roles exempt by this auto moderation rule.
guild:Guild
The guild this auto moderation rule is for.
The id of this auto moderation rule.
name:string
The name of this auto moderation rule.
The trigger metadata of the rule.
The trigger type of this auto moderation rule.
delete(reason?):Promise<void>
Deletes this auto moderation rule.
NameTypeOptionalDescription
reasonstringYesThe reason for deleting this auto moderation rule
Edits this auto moderation rule.
NameTypeOptionalDescription
optionsAutoModerationRuleEditOptionsNoOptions for editing this auto moderation rule
setActions(actions, reason?):Promise<AutoModerationRule>
Sets the actions for this auto moderation rule.
NameTypeOptionalDescription
actionsreadonly AutoModerationActionOptions[]NoThe actions of this auto moderation rule
reasonstringYesThe reason for changing the actions of this auto moderation rule
setAllowList(allowList, reason?):Promise<AutoModerationRule>
Sets the allow list for this auto moderation rule.
NameTypeOptionalDescription
allowListreadonly string[]NoThe substrings that will be exempt from triggering AutoModerationRuleTriggerType.Keyword, AutoModerationRuleTriggerType.KeywordPreset, and AutoModerationRuleTriggerType.MemberProfile
reasonstringYesThe reason for changing the allow list of this auto moderation rule
setEnabled(enabled?, reason?):Promise<AutoModerationRule>
Sets whether this auto moderation rule should be enabled.
NameTypeOptionalDescription
enabledbooleanYesWhether to enable this auto moderation rule
reasonstringYesThe reason for enabling or disabling this auto moderation rule
setEventType(eventType, reason?):Promise<AutoModerationRule>
Sets the event type for this auto moderation rule.
NameTypeOptionalDescription
eventTypeAutoModerationRuleEventTypeNoThe event type of this auto moderation rule
reasonstringYesThe reason for changing the event type of this auto moderation rule
setExemptChannels(exemptChannels, reason?):Promise<AutoModerationRule>
Sets the exempt channels for this auto moderation rule.
NameTypeOptionalDescription
exemptChannelsReadonlyCollection<Snowflake, GuildBasedChannel> | readonly GuildChannelResolvable[]NoThe channels that should not be affected by the auto moderation rule
reasonstringYesThe reason for changing the exempt channels of this auto moderation rule
setExemptRoles(exemptRoles, reason?):Promise<AutoModerationRule>
Sets the exempt roles for this auto moderation rule.
NameTypeOptionalDescription
exemptRolesReadonlyCollection<Snowflake, Role> | readonly RoleResolvable[]NoThe roles that should not be affected by the auto moderation rule
reasonstringYesThe reason for changing the exempt roles of this auto moderation rule
setKeywordFilter(keywordFilter, reason?):Promise<AutoModerationRule>
Sets the keyword filter for this auto moderation rule.
NameTypeOptionalDescription
keywordFilterreadonly string[]NoThe keyword filter of this auto moderation rule
reasonstringYesThe reason for changing the keyword filter of this auto moderation rule
setMentionRaidProtectionEnabled(mentionRaidProtectionEnabled, reason?):Promise<AutoModerationRule>
Sets whether to enable mention raid protection for this auto moderation rule.
NameTypeOptionalDescription
mentionRaidProtectionEnabledbooleanNoWhether to enable mention raid protection for this auto moderation rule
reasonstringYesThe reason for changing the mention raid protection of this auto moderation rule
setMentionTotalLimit(mentionTotalLimit, reason?):Promise<AutoModerationRule>
Sets the mention total limit for this auto moderation rule.
NameTypeOptionalDescription
mentionTotalLimitnumberNoThe total number of unique role and user mentions allowed per message
reasonstringYesThe reason for changing the mention total limit of this auto moderation rule
setName(name, reason?):Promise<AutoModerationRule>
Sets the name for this auto moderation rule.
NameTypeOptionalDescription
namestringNoThe name of this auto moderation rule
reasonstringYesThe reason for changing the name of this auto moderation rule
setPresets(presets, reason?):Promise<AutoModerationRule>
Sets the presets for this auto moderation rule.
NameTypeOptionalDescription
presetsreadonly AutoModerationRuleKeywordPresetType[]NoThe presets of this auto moderation rule
reasonstringYesThe reason for changing the presets of this auto moderation rule
setRegexPatterns(regexPatterns, reason?):Promise<AutoModerationRule>
Sets the regular expression patterns for this auto moderation rule.
NameTypeOptionalDescription
regexPatternsreadonly string[]NoThe regular expression patterns of this auto moderation rule Only Rust-flavored regular expressions are supported.
reasonstringYesThe reason for changing the regular expression patterns of this auto moderation rule
toJSON(...props):unknown
NameTypeOptionalDescription
...propsRecord<string, boolean | string>[]NoNone
Inherited from Base
valueOf():string