Constructor
new AutoModerationRule()
Properties:
| Name | Type | Attributes | Description | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
actions |
Array.<Object>
|
The actions that will be executed if the rule is triggered |
|||||||||||||||||||||||||
actions[].metadata |
Object
|
<nullable> |
Additional data used when an action is executed |
||||||||||||||||||||||||
| Name | Type | Attributes | Description |
|---|---|---|---|
channelID |
String
|
<nullable> |
The channel where user content will be logged (action type 2 only) |
customMessage |
String
|
<nullable> |
Optional custom message up to 150 characters that will be shown to users when their message gets blocked (action type 1 only) |
durationSeconds |
Number
|
<nullable> |
Timeout duration in seconds, up to 4 weeks (action type 3 only) |
creatorUser
The user that created the Auto Moderation rule. If the user is uncached, this will be an object with an id key. No other properties are guaranteed
enabledBoolean
Whether the rule is enabled or not
eventTypeNumber
Whether this rule applies for message sends (1) or member updates (2)
exemptChannelsArray.<String>
A list of channel IDs that aren't affected by this rule
exemptRolesArray.<String>
A list of role IDs that aren't affected by this rule
guildGuild
The guild which this rule applies to. If the guild is uncached, this will be an object with an id key. No other properties are guaranteed
idString
The Auto Moderation Rule ID
nameString
The name of this rule
triggerMetadataObject
Additional data used to determine whether a rule is triggered or not
Properties
| Name | Type | Attributes | Description |
|---|---|---|---|
allowList |
Array.<String>
|
<nullable> |
Substrings which shouldn't trigger this rule (trigger types 1, 4 and 6 only). Max of 100 for types 1 and 6, max of 1000 for type 4 |
keywordFilter |
Array.<String>
|
<nullable> |
Substrings which should trigger this rule (trigger types 1 and 6 only). Max of 1000 |
mentionRaidProtectionEnabled |
Boolean
|
<nullable> |
Whether to automatically detect mention raids |
mentionTotalLimit |
Number
|
<nullable> |
The number of unique roles/user mentions allowed per message. Max of 50 |
presets |
Array.<Number>
|
<nullable> |
The predefined wordsets which should trigger this rule. 1 for profanity, 2 for sexual content, 3 for slurs |
regexPatterns |
Array.<String>
|
<nullable> |
Rust flavored Regex patterns which should trigger this rule. Max of 10 |
triggerTypeNumber
The type of content which triggers this rule
- Source:
Methods
delete(reasonopt) → {Promise}
Delete the auto moderation rule
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
reason |
String
|
<optional> |
The reason to be displayed in audit logs |
Returns:
- Type:
-
Promise
edit(options) → {Promise.<AutoModerationRule>}
Edit an existing auto moderation rule
- Source:
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The properties to edit
|
Returns:
- Type:
-
Promise.<AutoModerationRule>