Skip to content

AutoModerationRule ​

classe · Source

Represents an auto moderation rule.

Extends: Base

Properties ​

id ​

id: Snowflake

The id of this auto moderation rule. Source

guild ​

guild: Guild

The guild this auto moderation rule is for. Source

creatorId ​

creatorId: Snowflake

The user that created this auto moderation rule. Source

triggerType ​

triggerType: AutoModerationRuleTriggerType

The trigger type of this auto moderation rule. Source

name ​

name: string

The name of this auto moderation rule. Source

eventType ​

eventType: AutoModerationRuleEventType

The event type of this auto moderation rule. Source

triggerMetadata ​

triggerMetadata: AutoModerationTriggerMetadata

The trigger metadata of the rule. Source

actions ​

actions: Array<AutoModerationAction>

The actions of this auto moderation rule. Source

enabled ​

enabled: boolean

Whether this auto moderation rule is enabled. Source

exemptRoles ​

exemptRoles: Collection<Snowflake, Role>

The roles exempt by this auto moderation rule. Source

exemptChannels ​

exemptChannels: Collection<Snowflake, (GuildChannel|ThreadChannel)>

The channels exempt by this auto moderation rule. Source

client ​

readonly

client: Client

The client that instantiated this Source

Methods ​

edit ​

edit(options: AutoModerationRuleEditOptions): Promise<AutoModerationRule>

Edits this auto moderation rule. Parameters

NameTypeDescription
optionsAutoModerationRuleEditOptionsOptions for editing this auto moderation rule

Returns: Promise<AutoModerationRule>Source

delete ​

delete(reason?: string): Promise<void>

Deletes this auto moderation rule. Parameters

NameTypeDescription
reason?stringThe reason for deleting this auto moderation rule

Returns: Promise<void>Source

setName ​

setName(name: string, reason?: string): Promise<AutoModerationRule>

Sets the name for this auto moderation rule. Parameters

NameTypeDescription
namestringThe name of this auto moderation rule
reason?stringThe reason for changing the name of this auto moderation rule

Returns: Promise<AutoModerationRule>Source

setEventType ​

setEventType(eventType: AutoModerationRuleEventType, reason?: string): Promise<AutoModerationRule>

Sets the event type for this auto moderation rule. Parameters

NameTypeDescription
eventTypeAutoModerationRuleEventTypeThe event type of this auto moderation rule
reason?stringThe reason for changing the event type of this auto moderation rule

Returns: Promise<AutoModerationRule>Source

setKeywordFilter ​

setKeywordFilter(keywordFilter: Array<string>, reason?: string): Promise<AutoModerationRule>

Sets the keyword filter for this auto moderation rule. Parameters

NameTypeDescription
keywordFilterArray<string>The keyword filter of this auto moderation rule
reason?stringThe reason for changing the keyword filter of this auto moderation rule

Returns: Promise<AutoModerationRule>Source

setRegexPatterns ​

setRegexPatterns(regexPatterns: Array<string>, reason?: string): Promise<AutoModerationRule>

Sets the regular expression patterns for this auto moderation rule. Parameters

NameTypeDescription
regexPatternsArray<string>The regular expression patterns of this auto moderation rule
Only Rust-flavored regular expressions are supported.
reason?stringThe reason for changing the regular expression patterns of this auto moderation rule

Returns: Promise<AutoModerationRule>Source

setPresets ​

setPresets(presets: Array<AutoModerationRuleKeywordPresetType>, reason?: string): Promise<AutoModerationRule>

Sets the presets for this auto moderation rule. Parameters

NameTypeDescription
presetsArray<AutoModerationRuleKeywordPresetType>The presets of this auto moderation rule
reason?stringThe reason for changing the presets of this auto moderation rule

Returns: Promise<AutoModerationRule>Source

setAllowList ​

setAllowList(allowList: Array<string>, reason?: string): Promise<AutoModerationRule>

Sets the allow list for this auto moderation rule. Parameters

NameTypeDescription
allowListArray<string>The allow list of this auto moderation rule
reason?stringThe reason for changing the allow list of this auto moderation rule

Returns: Promise<AutoModerationRule>Source

setMentionTotalLimit ​

setMentionTotalLimit(mentionTotalLimit: number, reason?: string): Promise<AutoModerationRule>

Sets the mention total limit for this auto moderation rule. Parameters

NameTypeDescription
mentionTotalLimitnumberThe mention total limit of this auto moderation rule
reason?stringThe reason for changing the mention total limit of this auto moderation rule

Returns: Promise<AutoModerationRule>Source

setMentionRaidProtectionEnabled ​

setMentionRaidProtectionEnabled(mentionRaidProtectionEnabled: boolean, reason?: string): Promise<AutoModerationRule>

Sets whether to enable mention raid protection for this auto moderation rule. Parameters

NameTypeDescription
mentionRaidProtectionEnabledbooleanWhether to enable mention raid protection for this auto moderation rule
reason?stringThe reason for changing the mention raid protection of this auto moderation rule

Returns: Promise<AutoModerationRule>Source

setActions ​

setActions(actions: Array<AutoModerationActionOptions>, reason?: string): Promise<AutoModerationRule>

Sets the actions for this auto moderation rule. Parameters

NameTypeDescription
actionsArray<AutoModerationActionOptions>The actions of this auto moderation rule
reason?stringThe reason for changing the actions of this auto moderation rule

Returns: Promise<AutoModerationRule>Source

setEnabled ​

setEnabled(enabled?: boolean, reason?: string): Promise<AutoModerationRule>

Sets whether this auto moderation rule should be enabled. Parameters

NameTypeDescription
enabled?booleanWhether to enable this auto moderation rule Default: true.
reason?stringThe reason for enabling or disabling this auto moderation rule

Returns: Promise<AutoModerationRule>Source

setExemptRoles ​

setExemptRoles(exemptRoles?: Collection<Snowflake, Role> | Array<RoleResolvable>, reason?: string): Promise<AutoModerationRule>

Sets the exempt roles for this auto moderation rule. Parameters

NameTypeDescription
exemptRoles?Collection<Snowflake, Role> | Array<RoleResolvable>The exempt roles of this auto moderation rule
reason?stringThe reason for changing the exempt roles of this auto moderation rule

Returns: Promise<AutoModerationRule>Source

setExemptChannels ​

setExemptChannels(exemptChannels?: Collection<Snowflake, (GuildChannel|ThreadChannel)> | Array<GuildChannelResolvable>, reason?: string): Promise<AutoModerationRule>

Sets the exempt channels for this auto moderation rule. Parameters

NameTypeDescription
exemptChannels?Collection<Snowflake, (GuildChannel|ThreadChannel)> | Array<GuildChannelResolvable>The exempt channels of this auto moderation rule
reason?stringThe reason for changing the exempt channels of this auto moderation rule

Returns: Promise<AutoModerationRule>Source

Unofficial software. Not affiliated with or supported by Discord.