Skip to content

[automod] Add allow_list for keyword rule and bump regex keyword limit - #5670

Merged
hemu merged 1 commit into
mainfrom
hemu/am-regex-limits-and-allowlist
Nov 22, 2022
Merged

[automod] Add allow_list for keyword rule and bump regex keyword limit#5670
hemu merged 1 commit into
mainfrom
hemu/am-regex-limits-and-allowlist

Conversation

@hemu

@hemu hemu commented Nov 22, 2022

Copy link
Copy Markdown
Contributor

1.) Add support for allow_list field for KEYWORD trigger type
2.) Bump max regex keyword length from 75 -> 260

@hemu
hemu force-pushed the hemu/am-regex-limits-and-allowlist branch from fc8abfb to fa2f067 Compare November 22, 2022 16:11
@hemu
hemu requested a review from shaydewael November 22, 2022 16:12
@hemu

hemu commented Nov 22, 2022

Copy link
Copy Markdown
Contributor Author

@shaydewael is this change big enough to warrant a Change Log entry?


\*** Each `allow_list` keyword can be a phrase which contains multiple words. [Wildcard symbols](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-keyword-matching-strategies) can be used to customize how each keyword will be matched. Rules with `KEYWORD` [trigger_type](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-trigger-types) accept a maximum of 100 keywords. Rules with `KEYWORD_PRESET` [trigger_type](#DOCS_RESOURCES_AUTO_MODERATION/auto-moderation-rule-object-trigger-types) accept a maximum of 1000 keywords.

###### Trigger Metadata Field Limits

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

summarizing the info in the above footnotes in table format here for easier reference.

@hemu
hemu merged commit 4161802 into main Nov 22, 2022
@hemu
hemu deleted the hemu/am-regex-limits-and-allowlist branch November 22, 2022 23:05
lukellmann added a commit to kordlib/kord that referenced this pull request Nov 23, 2022
The DSL for creating/editing KeywordAutoModerationRules with
allowedKeywords looks like this:
val rule = guild.createKeywordAutoModerationRule("name") {
    anywhereKeyword("cat")
    allowPrefixKeyword("black cat")
    timeout(10.minutes)
    enabled = true
}
println(rule.allowedKeywords)

Since allow list keywords can contain wildcard symbols now[1],
the allowPrefixKeyword, allowSuffixKeyword and allowAnywhereKeyword
extensions were added to AllowedKeywordsAutoModerationRuleBuilder to be
consistent with the extensions for KeywordAutoModerationRuleBuilder.

The documentation for regex pattern max length was also updated.

see discord/discord-api-docs#5670,
discord/discord-api-docs#5672 and
discord/discord-api-docs#5673

[1] discord/discord-api-docs#5644 (comment)
Nihlus added a commit to Remora/Remora.Discord that referenced this pull request Nov 24, 2022
VelvetToroyashi pushed a commit to VelvetToroyashi/Remora.Discord that referenced this pull request Dec 2, 2022
lukellmann added a commit to kordlib/kord that referenced this pull request Jan 23, 2023
The DSL for creating/editing KeywordAutoModerationRules with
allowedKeywords looks like this:
val rule = guild.createKeywordAutoModerationRule("name") {
    anywhereKeyword("cat")
    allowPrefixKeyword("black cat")
    timeout(10.minutes)
    enabled = true
}
println(rule.allowedKeywords)

Since allow list keywords can contain wildcard symbols now[1],
the allowPrefixKeyword, allowSuffixKeyword and allowAnywhereKeyword
extensions were added to AllowedKeywordsAutoModerationRuleBuilder to be
consistent with the extensions for KeywordAutoModerationRuleBuilder.

The documentation for regex pattern max length was also updated.

see discord/discord-api-docs#5670,
discord/discord-api-docs#5672 and
discord/discord-api-docs#5673

[1] discord/discord-api-docs#5644 (comment)
lukellmann added a commit to kordlib/kord that referenced this pull request Jan 24, 2023
The DSL for creating/editing KeywordAutoModerationRules with
allowedKeywords looks like this:
val rule = guild.createKeywordAutoModerationRule("name") {
    anywhereKeyword("cat")
    allowPrefixKeyword("black cat")
    timeout(10.minutes)
    enabled = true
}
println(rule.allowedKeywords)

Since allow list keywords can contain wildcard symbols now[1],
the allowPrefixKeyword, allowSuffixKeyword and allowAnywhereKeyword
extensions were added to AllowedKeywordsAutoModerationRuleBuilder to be
consistent with the extensions for KeywordAutoModerationRuleBuilder.

The documentation for regex pattern max length was also updated.

see discord/discord-api-docs#5670,
discord/discord-api-docs#5672 and
discord/discord-api-docs#5673

[1] discord/discord-api-docs#5644 (comment)
xavier-archlinux-tw pushed a commit to xavier-archlinux-tw/discord-api-docs that referenced this pull request Jul 14, 2026
discord#5670)

for the Auto Moderation feature:
- add support for allow_list field for KEYWORD trigger type
- bump max regex keyword length from 75 -> 260
- make table headers a bit clearer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant