fix(types): Add missing trigger metadata values (#4260)

* Add missing triggerMetadata

* Add link for EditAutoModerationRuleOptions

* Update TriggerMetadata comments

* Apply suggestions from code review

---------

Co-authored-by: Awesome Stickz <awesome@stickz.dev>
This commit is contained in:
Fleny
2025-07-28 08:41:51 +02:00
committed by GitHub
co-authored by Awesome Stickz
parent 39279466ce
commit b6bfaa38a8
2 changed files with 57 additions and 13 deletions
+8 -8
View File
@@ -43,12 +43,12 @@ export enum AutoModerationTriggerTypes {
/** https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata */
export interface DiscordAutoModerationRuleTriggerMetadata {
/**
* The keywords needed to match.
* Substrings which will be searched for in content.
*
* @remarks
* Only present with {@link AutoModerationTriggerTypes.Keyword} and {@link AutoModerationTriggerTypes.MemberProfile}.
*
* Can have up to 1000 elements in the array and each string can have up to 60 characters
* Can have up to 1000 elements in the array and each string can have up to 60 characters.
*/
keyword_filter?: string[]
/**
@@ -57,28 +57,28 @@ export interface DiscordAutoModerationRuleTriggerMetadata {
* @remarks
* Only present with {@link AutoModerationTriggerTypes.Keyword} and {@link AutoModerationTriggerTypes.MemberProfile}.
*
* Can have up to 10 elements in the array and each string can have up to 260 characters
* Only Rust flavored regex is currently supported. Can have up to 10 elements in the array and each string can have up to 260 characters.
*/
regex_patterns?: string[]
/**
* The pre-defined lists of words to match from.
* The Discord pre-defined wordsets which will be searched for in content.
*
* @remarks
* Only present with {@link AutoModerationTriggerTypes.KeywordPreset}.
*/
presets?: DiscordAutoModerationRuleTriggerMetadataPresets[]
/**
* The substrings which will exempt from triggering the preset trigger type.
* The substrings which should not trigger the rule.
*
* @remarks
* Only present with {@link AutoModerationTriggerTypes.Keyword}, {@link AutoModerationTriggerTypes.KeywordPreset} and {@link AutoModerationTriggerTypes.MemberProfile}.
*
* When used with {@link AutoModerationTriggerTypes.Keyword} and {@link AutoModerationTriggerTypes.MemberProfile} there can have up to 100 elements in the array and each string can have up to 60 characters.
* When used with {@link AutoModerationTriggerTypes.KeywordPreset} there can have up to 1000 elements in the array and each string can have up to 60 characters.
* When used with {@link AutoModerationTriggerTypes.Keyword} and {@link AutoModerationTriggerTypes.MemberProfile}, there can be up to 100 elements in the array and each string can have up to 60 characters.
* When used with {@link AutoModerationTriggerTypes.KeywordPreset}, there can be up to 1000 elements in the array and each string can have up to 60 characters.
*/
allow_list?: string[]
/**
* Total number of mentions (role & user) allowed per message.
* Total number of unique role and user mentions allowed per message.
*
* @remarks
* Only present with {@link AutoModerationTriggerTypes.MentionSpam}.
+49 -5
View File
@@ -1288,6 +1288,7 @@ export interface CreateAutoModerationRuleOptions {
exemptChannels?: BigString[]
}
/** https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule-json-params */
export interface EditAutoModerationRuleOptions {
/** The name of the rule. */
name: string
@@ -1295,14 +1296,57 @@ export interface EditAutoModerationRuleOptions {
eventType: AutoModerationEventTypes
/** The metadata to use for the trigger. */
triggerMetadata: {
/** The keywords needed to match. Only present when TriggerType.Keyword */
/**
* Substrings which will be searched for in content.
*
* @remarks
* Only present with {@link AutoModerationTriggerTypes.Keyword} and {@link AutoModerationTriggerTypes.MemberProfile}.
*
* Can have up to 1000 elements in the array and each string can have up to 60 characters.
*/
keywordFilter?: string[]
/** The pre-defined lists of words to match from. Only present when TriggerType.KeywordPreset */
/**
* Regular expression patterns which will be matched against content.
*
* @remarks
* Only present with {@link AutoModerationTriggerTypes.Keyword} and {@link AutoModerationTriggerTypes.MemberProfile}.
*
* Only Rust flavored regex is currently supported. Can have up to 10 elements in the array and each string can have up to 260 characters.
*/
regexPatterns?: string[]
/**
* The discord pre-defined wordsets which will be searched for in content.
*
* @remarks
* Only present with {@link AutoModerationTriggerTypes.KeywordPreset}.
*/
presets?: DiscordAutoModerationRuleTriggerMetadataPresets[]
/** The substrings which will exempt from triggering the preset trigger type. Only present when TriggerType.KeywordPreset */
/**
* The substrings which should not trigger the rule.
*
* @remarks
* Only present with {@link AutoModerationTriggerTypes.Keyword}, {@link AutoModerationTriggerTypes.KeywordPreset} and {@link AutoModerationTriggerTypes.MemberProfile}.
*
* When used with {@link AutoModerationTriggerTypes.Keyword} and {@link AutoModerationTriggerTypes.MemberProfile}, there can be up to 100 elements in the array and each string can have up to 60 characters.
* When used with {@link AutoModerationTriggerTypes.KeywordPreset}, there can be up to 1000 elements in the array and each string can have up to 60 characters.
*/
allowList?: string[]
/** Total number of mentions (role & user) allowed per message (Maximum of 50) */
mentionTotalLimit: number
/**
* Total number of unique role and user mentions allowed per message.
*
* @remarks
* Only present with {@link AutoModerationTriggerTypes.MentionSpam}.
*
* Maximum of 50
*/
mentionTotalLimit?: number
/**
* Whether to automatically detect mention raids.
*
* @remarks
* Only present with {@link AutoModerationTriggerTypes.MentionSpam}.
*/
mentionRaidProtectionEnabled?: boolean
}
/** The actions that will trigger for this rule */
actions: Array<{