AutoModRule

class AutoModRule()

An Auto Moderation rule configured for a guild.

exported from lib.weeble.d

Properties

AutoModRule.actions

type: readonly AutoModAction[]

Actions taken when this rule is triggered.

AutoModRule.createdAt

type: readonly Date

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

AutoModRule.enabled

type: readonly boolean

Indicates whether this rule is currently enabled.

AutoModRule.eventType

type: readonly 1

The type of event that triggers this rule.

AutoModRule.exemptChannels

type: readonly string[]

Channel IDs exempt from this rule.

AutoModRule.exemptRoles

type: readonly string[]

Role IDs exempt from this rule.

AutoModRule.guildId

type: readonly string

Guild ID this rule belongs to.

AutoModRule.id

type: readonly string

Auto moderation rule ID.

AutoModRule.name

type: readonly string

Rule name.

AutoModRule.triggerMetadata

type: readonly AutoModTriggerMetadata

Metadata specific to the trigger type.

AutoModRule.triggerType

type: readonly 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.