fix: automod
This commit is contained in:
parent
c4695b5a78
commit
b3d0a859f4
@ -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,
|
||||
|
@ -58,7 +58,7 @@ class AutoModerationActionExecution {
|
||||
|
||||
/**
|
||||
* The content that triggered this action.
|
||||
* <info>This property requires the {@link GatewayIntentBits.MessageContent} privileged gateway intent.</info>
|
||||
* <info>This property requires the {@link Intents.FLAGS.MESSAGE_CONTENT} privileged gateway intent.</info>
|
||||
* @type {string}
|
||||
*/
|
||||
this.content = data.content;
|
||||
|
@ -71,7 +71,7 @@ class AutoModerationRule extends Base {
|
||||
* @property {AutoModerationRuleKeywordPresetType[]} presets
|
||||
* The internally pre-defined wordsets which will be searched for in the content
|
||||
* @property {string[]} allowList The substrings that will be exempt from triggering
|
||||
* {@link AutoModerationRuleTriggerTypes.Keyword} and {@link AutoModerationRuleTriggerTypes.KeywordPreset}
|
||||
* {@link AutoModerationRuleTriggerTypes.KEYWORD} and {@link AutoModerationRuleTriggerTypes.KEYWORD_PRESET}
|
||||
* @property {?number} mentionTotalLimit The total number of role & user mentions allowed per message
|
||||
*/
|
||||
|
||||
@ -190,7 +190,7 @@ class AutoModerationRule extends Base {
|
||||
* @returns {Promise<AutoModerationRule>}
|
||||
*/
|
||||
setKeywordFilter(keywordFilter, reason) {
|
||||
return this.edit({ triggerMetadata: { ...this.triggerMetadata, keywordFilter }, reason });
|
||||
return this.edit({ triggerMetadata: { keywordFilter }, reason });
|
||||
}
|
||||
|
||||
/**
|
||||
@ -201,7 +201,7 @@ class AutoModerationRule extends Base {
|
||||
* @returns {Promise<AutoModerationRule>}
|
||||
*/
|
||||
setRegexPatterns(regexPatterns, reason) {
|
||||
return this.edit({ triggerMetadata: { ...this.triggerMetadata, regexPatterns }, reason });
|
||||
return this.edit({ triggerMetadata: { regexPatterns }, reason });
|
||||
}
|
||||
|
||||
/**
|
||||
@ -211,7 +211,7 @@ class AutoModerationRule extends Base {
|
||||
* @returns {Promise<AutoModerationRule>}
|
||||
*/
|
||||
setPresets(presets, reason) {
|
||||
return this.edit({ triggerMetadata: { ...this.triggerMetadata, presets }, reason });
|
||||
return this.edit({ triggerMetadata: { presets }, reason });
|
||||
}
|
||||
|
||||
/**
|
||||
@ -221,7 +221,7 @@ class AutoModerationRule extends Base {
|
||||
* @returns {Promise<AutoModerationRule>}
|
||||
*/
|
||||
setAllowList(allowList, reason) {
|
||||
return this.edit({ triggerMetadata: { ...this.triggerMetadata, allowList }, reason });
|
||||
return this.edit({ triggerMetadata: { allowList }, reason });
|
||||
}
|
||||
|
||||
/**
|
||||
@ -231,7 +231,7 @@ class AutoModerationRule extends Base {
|
||||
* @returns {Promise<AutoModerationRule>}
|
||||
*/
|
||||
setMentionTotalLimit(mentionTotalLimit, reason) {
|
||||
return this.edit({ triggerMetadata: { ...this.triggerMetadata, mentionTotalLimit }, reason });
|
||||
return this.edit({ triggerMetadata: { mentionTotalLimit }, reason });
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user