Skip to content

Commit

Permalink
feat(AutoModeration): add blocking words in member profile (#740)
Browse files Browse the repository at this point in the history
Co-authored-by: almeidx <github@almeidx.dev>
Co-authored-by: Vlad Frangu <me@vladfrangu.dev>
  • Loading branch information
3 people committed Jun 3, 2024
1 parent f859a96 commit 5097460
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 12 deletions.
18 changes: 15 additions & 3 deletions deno/payloads/v10/autoModeration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export enum AutoModerationRuleTriggerType {
* Check if content contains more mentions than allowed (Maximum of 1 per guild)
*/
MentionSpam,
/**
* Check if member profile contains words from a user defined list of keywords (Maximum of 1 per guild)
*/
MemberProfile,
}

/**
Expand All @@ -86,7 +90,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
* A keyword can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
*/
keyword_filter?: string[];
/**
Expand All @@ -101,15 +105,15 @@ export interface APIAutoModerationRuleTriggerMetadata {
* A allowed-word can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.KeywordPreset}, {@link AutoModerationRuleTriggerType.MemberProfile}
*/
allow_list?: string[];
/**
* Regular expression patterns which will be matched against content (Maximum of 10)
*
* Only Rust flavored regex is currently supported (Maximum of 260 characters)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
*/
regex_patterns?: string[];
/**
Expand Down Expand Up @@ -152,6 +156,10 @@ export enum AutoModerationRuleEventType {
* When a member sends or edits a message in the guild
*/
MessageSend = 1,
/**
* When a member edits their profile
*/
MemberUpdate,
}

/**
Expand Down Expand Up @@ -187,6 +195,10 @@ export enum AutoModerationActionType {
* Timeout user for specified duration, this action type can be set if the bot has `MODERATE_MEMBERS` permission
*/
Timeout,
/**
* Prevents a member from using text, voice, or other interactions
*/
BlockMemberInteraction,
}

/**
Expand Down
18 changes: 15 additions & 3 deletions deno/payloads/v9/autoModeration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export enum AutoModerationRuleTriggerType {
* Check if content contains more mentions than allowed (Maximum of 1 per guild)
*/
MentionSpam,
/**
* Check if member profile contains words from a user defined list of keywords (Maximum of 1 per guild)
*/
MemberProfile,
}

/**
Expand All @@ -86,7 +90,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
* A keyword can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
*/
keyword_filter?: string[];
/**
Expand All @@ -101,15 +105,15 @@ export interface APIAutoModerationRuleTriggerMetadata {
* A allowed-word can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.KeywordPreset}, {@link AutoModerationRuleTriggerType.MemberProfile}
*/
allow_list?: string[];
/**
* Regular expression patterns which will be matched against content (Maximum of 10)
*
* Only Rust flavored regex is currently supported (Maximum of 260 characters)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
*/
regex_patterns?: string[];
/**
Expand Down Expand Up @@ -152,6 +156,10 @@ export enum AutoModerationRuleEventType {
* When a member sends or edits a message in the guild
*/
MessageSend = 1,
/**
* When a member edits their profile
*/
MemberUpdate,
}

/**
Expand Down Expand Up @@ -187,6 +195,10 @@ export enum AutoModerationActionType {
* Timeout user for specified duration, this action type can be set if the bot has `MODERATE_MEMBERS` permission
*/
Timeout,
/**
* Prevents a member from using text, voice, or other interactions
*/
BlockMemberInteraction,
}

/**
Expand Down
18 changes: 15 additions & 3 deletions payloads/v10/autoModeration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export enum AutoModerationRuleTriggerType {
* Check if content contains more mentions than allowed (Maximum of 1 per guild)
*/
MentionSpam,
/**
* Check if member profile contains words from a user defined list of keywords (Maximum of 1 per guild)
*/
MemberProfile,
}

/**
Expand All @@ -86,7 +90,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
* A keyword can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
*/
keyword_filter?: string[];
/**
Expand All @@ -101,15 +105,15 @@ export interface APIAutoModerationRuleTriggerMetadata {
* A allowed-word can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.KeywordPreset}, {@link AutoModerationRuleTriggerType.MemberProfile}
*/
allow_list?: string[];
/**
* Regular expression patterns which will be matched against content (Maximum of 10)
*
* Only Rust flavored regex is currently supported (Maximum of 260 characters)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
*/
regex_patterns?: string[];
/**
Expand Down Expand Up @@ -152,6 +156,10 @@ export enum AutoModerationRuleEventType {
* When a member sends or edits a message in the guild
*/
MessageSend = 1,
/**
* When a member edits their profile
*/
MemberUpdate,
}

/**
Expand Down Expand Up @@ -187,6 +195,10 @@ export enum AutoModerationActionType {
* Timeout user for specified duration, this action type can be set if the bot has `MODERATE_MEMBERS` permission
*/
Timeout,
/**
* Prevents a member from using text, voice, or other interactions
*/
BlockMemberInteraction,
}

/**
Expand Down
18 changes: 15 additions & 3 deletions payloads/v9/autoModeration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ export enum AutoModerationRuleTriggerType {
* Check if content contains more mentions than allowed (Maximum of 1 per guild)
*/
MentionSpam,
/**
* Check if member profile contains words from a user defined list of keywords (Maximum of 1 per guild)
*/
MemberProfile,
}

/**
Expand All @@ -86,7 +90,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
* A keyword can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
*/
keyword_filter?: string[];
/**
Expand All @@ -101,15 +105,15 @@ export interface APIAutoModerationRuleTriggerMetadata {
* A allowed-word can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.KeywordPreset}, {@link AutoModerationRuleTriggerType.MemberProfile}
*/
allow_list?: string[];
/**
* Regular expression patterns which will be matched against content (Maximum of 10)
*
* Only Rust flavored regex is currently supported (Maximum of 260 characters)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
*/
regex_patterns?: string[];
/**
Expand Down Expand Up @@ -152,6 +156,10 @@ export enum AutoModerationRuleEventType {
* When a member sends or edits a message in the guild
*/
MessageSend = 1,
/**
* When a member edits their profile
*/
MemberUpdate,
}

/**
Expand Down Expand Up @@ -187,6 +195,10 @@ export enum AutoModerationActionType {
* Timeout user for specified duration, this action type can be set if the bot has `MODERATE_MEMBERS` permission
*/
Timeout,
/**
* Prevents a member from using text, voice, or other interactions
*/
BlockMemberInteraction,
}

/**
Expand Down

0 comments on commit 5097460

Please sign in to comment.