[automod] Add allow_list for keyword rule and bump regex keyword limit - #5670
Merged
Conversation
hemu
force-pushed
the
hemu/am-regex-limits-and-allowlist
branch
from
November 22, 2022 16:11
fc8abfb to
fa2f067
Compare
Contributor
Author
|
@shaydewael is this change big enough to warrant a Change Log entry? |
hemu
commented
Nov 22, 2022
|
|
||
| \*** 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 |
Contributor
Author
There was a problem hiding this comment.
summarizing the info in the above footnotes in table format here for easier reference.
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
3 tasks
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1.) Add support for
allow_listfield forKEYWORDtrigger type2.) Bump max regex keyword length from 75 -> 260