@@ -73,6 +73,7 @@ class AutoModerationRule extends Base {
|
||||
* @property {string[]} allowList The substrings that will be exempt from triggering
|
||||
* {@link AutoModerationRuleTriggerTypes.KEYWORD} and {@link AutoModerationRuleTriggerTypes.KEYWORD_PRESET}
|
||||
* @property {?number} mentionTotalLimit The total number of role & user mentions allowed per message
|
||||
* @property {boolean} mentionRaidProtectionEnabled Whether mention raid protection is enabled
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -85,6 +86,7 @@ class AutoModerationRule extends Base {
|
||||
presets: data.trigger_metadata.presets?.map(preset => AutoModerationRuleKeywordPresetTypes[preset]) ?? [],
|
||||
allowList: data.trigger_metadata.allow_list ?? [],
|
||||
mentionTotalLimit: data.trigger_metadata.mention_total_limit ?? null,
|
||||
mentionRaidProtectionEnabled: data.trigger_metadata.mention_raid_protection_enabled ?? false,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -234,6 +236,17 @@ class AutoModerationRule extends Base {
|
||||
return this.edit({ triggerMetadata: { mentionTotalLimit }, reason });
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets whether to enable mention raid protection for this auto moderation rule.
|
||||
* @param {boolean} mentionRaidProtectionEnabled
|
||||
* Whether to enable mention raid protection for this auto moderation rule
|
||||
* @param {string} [reason] The reason for changing the mention raid protection of this auto moderation rule
|
||||
* @returns {Promise<AutoModerationRule>}
|
||||
*/
|
||||
setMentionRaidProtectionEnabled(mentionRaidProtectionEnabled, reason) {
|
||||
return this.edit({ triggerMetadata: { ...this.triggerMetadata, mentionRaidProtectionEnabled }, reason });
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the actions for this auto moderation rule.
|
||||
* @param {AutoModerationActionOptions[]} actions The actions of this auto moderation rule
|
||||
|
||||
Reference in New Issue
Block a user