AutoModerationRule
classe · Source
Represents an auto moderation rule.
Extends: Base
Properties
id
The id of this auto moderation rule. Source
guild
The guild this auto moderation rule is for. Source
creatorId
The user that created this auto moderation rule. Source
triggerType
The trigger type of this auto moderation rule. Source
name
The name of this auto moderation rule. Source
eventType
The event type of this auto moderation rule. Source
triggerMetadata
The trigger metadata of the rule. Source
actions
The actions of this auto moderation rule. Source
enabled
Whether this auto moderation rule is enabled. Source
exemptRoles
The roles exempt by this auto moderation rule. Source
exemptChannels
The channels exempt by this auto moderation rule. Source
client
The client that instantiated this Source
Methods
edit
Edits this auto moderation rule. Parameters
| Name | Type | Description |
|---|---|---|
options | AutoModerationRuleEditOptions | Options for editing this auto moderation rule |
Returns: Promise<AutoModerationRule>Source
delete
Deletes this auto moderation rule. Parameters
| Name | Type | Description |
|---|---|---|
reason? | string | The reason for deleting this auto moderation rule |
Returns: Promise<void>Source
setName
Sets the name for this auto moderation rule. Parameters
| Name | Type | Description |
|---|---|---|
name | string | The name of this auto moderation rule |
reason? | string | The reason for changing the name of this auto moderation rule |
Returns: Promise<AutoModerationRule>Source
setEventType
Sets the event type for this auto moderation rule. Parameters
| Name | Type | Description |
|---|---|---|
eventType | AutoModerationRuleEventType | The event type of this auto moderation rule |
reason? | string | The reason for changing the event type of this auto moderation rule |
Returns: Promise<AutoModerationRule>Source
setKeywordFilter
Sets the keyword filter for this auto moderation rule. Parameters
| Name | Type | Description |
|---|---|---|
keywordFilter | Array<string> | The keyword filter of this auto moderation rule |
reason? | string | The reason for changing the keyword filter of this auto moderation rule |
Returns: Promise<AutoModerationRule>Source
setRegexPatterns
Sets the regular expression patterns for this auto moderation rule. Parameters
| Name | Type | Description |
|---|---|---|
regexPatterns | Array<string> | The regular expression patterns of this auto moderation rule Only Rust-flavored regular expressions are supported. |
reason? | string | The reason for changing the regular expression patterns of this auto moderation rule |
Returns: Promise<AutoModerationRule>Source
setPresets
Sets the presets for this auto moderation rule. Parameters
| Name | Type | Description |
|---|---|---|
presets | Array<AutoModerationRuleKeywordPresetType> | The presets of this auto moderation rule |
reason? | string | The reason for changing the presets of this auto moderation rule |
Returns: Promise<AutoModerationRule>Source
setAllowList
Sets the allow list for this auto moderation rule. Parameters
| Name | Type | Description |
|---|---|---|
allowList | Array<string> | The allow list of this auto moderation rule |
reason? | string | The reason for changing the allow list of this auto moderation rule |
Returns: Promise<AutoModerationRule>Source
setMentionTotalLimit
Sets the mention total limit for this auto moderation rule. Parameters
| Name | Type | Description |
|---|---|---|
mentionTotalLimit | number | The mention total limit of this auto moderation rule |
reason? | string | The reason for changing the mention total limit of this auto moderation rule |
Returns: Promise<AutoModerationRule>Source
setMentionRaidProtectionEnabled
Sets whether to enable mention raid protection for this auto moderation rule. Parameters
| Name | Type | Description |
|---|---|---|
mentionRaidProtectionEnabled | boolean | Whether to enable mention raid protection for this auto moderation rule |
reason? | string | The reason for changing the mention raid protection of this auto moderation rule |
Returns: Promise<AutoModerationRule>Source
setActions
Sets the actions for this auto moderation rule. Parameters
| Name | Type | Description |
|---|---|---|
actions | Array<AutoModerationActionOptions> | The actions of this auto moderation rule |
reason? | string | The reason for changing the actions of this auto moderation rule |
Returns: Promise<AutoModerationRule>Source
setEnabled
Sets whether this auto moderation rule should be enabled. Parameters
| Name | Type | Description |
|---|---|---|
enabled? | boolean | Whether to enable this auto moderation rule Default: true. |
reason? | string | The reason for enabling or disabling this auto moderation rule |
Returns: Promise<AutoModerationRule>Source
setExemptRoles
Sets the exempt roles for this auto moderation rule. Parameters
| Name | Type | Description |
|---|---|---|
exemptRoles? | Collection<Snowflake, Role> | Array<RoleResolvable> | The exempt roles of this auto moderation rule |
reason? | string | The reason for changing the exempt roles of this auto moderation rule |
Returns: Promise<AutoModerationRule>Source
setExemptChannels
Sets the exempt channels for this auto moderation rule. Parameters
| Name | Type | Description |
|---|---|---|
exemptChannels? | Collection<Snowflake, (GuildChannel|ThreadChannel)> | Array<GuildChannelResolvable> | The exempt channels of this auto moderation rule |
reason? | string | The reason for changing the exempt channels of this auto moderation rule |
Returns: Promise<AutoModerationRule>Source