Skip to content

DiscordAutomoderationRule

The DiscordAutomoderationRule class provides methods to interact with Discord auto-moderation rules, including modifying and deleting rules.

Properties

id

DiscordAutomoderationRule.id  :: string

guildId

DiscordAutomoderationRule.guildId  :: string

name

DiscordAutomoderationRule.name  :: string

eventType

DiscordAutomoderationRule.eventType  :: number

triggerType

DiscordAutomoderationRule.triggerType  :: number

enabled

DiscordAutomoderationRule.enabled  :: boolean

exemptRoles

DiscordAutomoderationRule.exemptRoles  :: { string }

exemptChannels

DiscordAutomoderationRule.exemptChannels  :: { string }

triggerMetadata

DiscordAutomoderationRule.triggerMetadata  :: {
      {… keywordFilter: { string …}    }

actions

DiscordAutomoderationRule.actions  :: {
       type: number,
       metadata: { channelId,
       durationSeconds: number,
       customMessage: string?,
    }

Methods

modifyAsync

DiscordAutomoderationRule : modifyAsync (

     moderationRoleBuilder: DiscordAutomoderationRule.DiscordAutomoderationRule The builder for the modified rule.
)  -> Vendor.Future<CommandResponse>

Modifies an existing auto-moderation rule.

deleteAsync

DiscordAutomoderationRule : deleteAsync ()  -> Vendor.Future<CommandResponse>

Deletes an existing auto-moderation rule.

Functions

new

DiscordAutomoderationRule . new (

     discordClient: any The Discord client instance.
     automoderationData: table The data for the auto-moderation rule.
)  -> ()

Creates a new instance of the DiscordAutomoderationRule.