AutoModRule

class AutoModRule

An Auto Moderation rule configured for a guild.

Properties

Property

Type

Description

actions

AutoModAction[]

Actions taken when this rule is triggered.

createdAt

Date

When this auto moderation rule was created, decoded from the rule snowflake.

enabled

boolean

Indicates whether this rule is currently enabled.

eventType

1

The type of event that triggers this rule.

exemptChannels

string[]

Channel IDs exempt from this rule.

exemptRoles

string[]

Role IDs exempt from this rule.

guildId

string

Guild ID this rule belongs to.

id

string

Auto moderation rule ID.

name

string

Rule name.

triggerMetadata

AutoModTriggerMetadata

Metadata specific to the trigger type.

triggerType

AutoModTriggerType

The type of trigger used by this rule.

Methods

async AutoModRule.delete(reason: string) → Promise<void>

Delete this rule.

Parameters:
  • reason: Reason for deletion, shown in audit log.

async AutoModRule.edit(options: AutoModRuleEditOptions) → Promise<AutoModRule>

Edit rule properties.

Parameters:
  • options: Rule properties to update.

Returns:

The updated rule.