fix: automod

This commit is contained in:
March 7th
2022-12-26 17:53:25 +07:00
parent c4695b5a78
commit b3d0a859f4
3 changed files with 9 additions and 10 deletions

View File

@@ -33,8 +33,7 @@ class AutoModerationRuleManager extends CachedManager {
* Options used to set the trigger metadata of an auto moderation rule.
* @typedef {Object} AutoModerationTriggerMetadataOptions
* @property {string[]} [keywordFilter] The substrings that will be searched for in the content
* @property {string[]} [regexPatterns] The regular expression patterns
* which will be matched against the content
* @property {string[]} [regexPatterns] The regular expression patterns which will be matched against the content
* <info>Only Rust-flavored regular expressions are supported.</info>
* @property {AutoModerationRuleKeywordPresetType[]} [presets]
* The internally pre-defined wordsets which will be searched for in the content
@@ -109,7 +108,7 @@ class AutoModerationRuleManager extends CachedManager {
allow_list: triggerMetadata.allowList,
mention_total_limit: triggerMetadata.mentionTotalLimit,
},
actions: actions?.map(action => ({
actions: actions.map(action => ({
type: typeof action.type === 'number' ? action.type : AutoModerationActionTypes[action.type],
metadata: {
duration_seconds: action.metadata?.durationSeconds,