feat: Adds mention limits in automod (#2414)

* Adds mention limits in automod

* add mention limit to automod helper, transformer

* helpers/automod: send mention_total_limit to discord
This commit is contained in:
LTS20050703
2022-09-04 12:02:42 -05:00
committed by GitHub
parent 792c48b498
commit 3a95a1beda
4 changed files with 10 additions and 0 deletions
@@ -26,6 +26,7 @@ export async function createAutomodRule(
keyword_filter: options.triggerMetadata.keywordFilter,
presets: options.triggerMetadata.presets,
allow_list: options.triggerMetadata.allowList,
mention_total_limit: options.triggerMetadata.mentionTotalLimit,
},
actions: options.actions.map((action) => ({
type: action.type,
@@ -61,6 +62,8 @@ export interface CreateAutoModerationRuleOptions {
presets?: DiscordAutoModerationRuleTriggerMetadataPresets[];
/** The substrings which will exempt from triggering the preset trigger type. Only present when TriggerType.KeywordPreset */
allowList?: string[];
/** Total number of mentions (role & user) allowed per message (Maximum of 50) */
mentionTotalLimit: number;
};
/** The actions that will trigger for this rule */
actions: {
@@ -25,6 +25,7 @@ export async function editAutomodRule(
keyword_filter: options.triggerMetadata.keywordFilter,
presets: options.triggerMetadata.presets,
allow_list: options.triggerMetadata.allowList,
mention_total_limit: options.triggerMetadata.mentionTotalLimit,
}
: undefined,
actions: options.actions?.map((action) => ({
@@ -58,6 +59,8 @@ export interface EditAutoModerationRuleOptions {
presets?: DiscordAutoModerationRuleTriggerMetadataPresets[];
/** The substrings which will exempt from triggering the preset trigger type. Only present when TriggerType.KeywordPreset */
allowList?: string[];
/** Total number of mentions (role & user) allowed per message (Maximum of 50) */
mentionTotalLimit: number;
};
/** The actions that will trigger for this rule */
actions: {