feat: v13 safety alerts channel and mention raid protection

#9073 djs
This commit is contained in:
Elysia
2023-02-12 15:30:49 +07:00
parent 779fc7a5f4
commit f28ea5c031
4 changed files with 63 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ class AutoModerationRuleManager extends CachedManager {
* @property {string[]} [allowList] The substrings that will be exempt from triggering
* {@link AutoModerationRuleTriggerType.KEYWORD} and {@link AutoModerationRuleTriggerType.KEYWORD_PRESET}
* @property {?number} [mentionTotalLimit] The total number of role & user mentions allowed per message
* @property {boolean} [mentionRaidProtectionEnabled] Whether to automatically detect mention raids
*/
/**
@@ -125,6 +126,7 @@ class AutoModerationRuleManager extends CachedManager {
),
allow_list: triggerMetadata.allowList,
mention_total_limit: triggerMetadata.mentionTotalLimit,
mention_raid_protection_enabled: triggerMetadata.mentionRaidProtectionEnabled,
},
actions: actions.map(action => ({
type: typeof action.type === 'number' ? action.type : AutoModerationActionTypes[action.type],
@@ -186,6 +188,7 @@ class AutoModerationRuleManager extends CachedManager {
),
allow_list: triggerMetadata.allowList,
mention_total_limit: triggerMetadata.mentionTotalLimit,
mention_raid_protection_enabled: triggerMetadata.mentionRaidProtectionEnabled,
},
actions: actions?.map(action => ({
type: typeof action.type === 'number' ? action.type : AutoModerationActionTypes[action.type],