-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Automod] Add support for regex matching #5504
Conversation
dc7a2f6
to
51cb5a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this implies that we can set keyword filters and regex patterns for the same rule, is this correct?
yep, thats right |
51cb5a3
to
4086c7a
Compare
Co-authored-by: Danny <[email protected]>
Going to merge this in. If ya'll notice I missed something or documented something incorrectly (like missing JSON escaping the backslash in the example -- ty Rapptz and MinnDevelopment for catching that 🙂) feel free to comment here after and ping me. |
5e5266f
to
4a09e29
Compare
Looks good hemu 👌 |
4a09e29
to
4a9d744
Compare
This still has the not-released label? |
implements discord/discord-api-docs#5504 Signed-off-by: arl <[email protected]>
The DSL looks like this: val rule = guild.createKeywordAutoModerationRule("name") { regexPattern("^b(a|@)d\$w(o|0)rd(s|$)") blockMessage() enabled = true } println(rule.regexPatterns) KeywordAutoModerationRuleBuilder.assignKeywords() was dropped and KeywordAutoModerationRuleBuilder.keywords was changed to var instead because it is no longer strictly required for creating rules. At least one of keywords or regexPatterns is required instead. The builder documentation was also updated to include the limits documented in #5504. see discord/discord-api-docs#5504
removed, ty for catching that |
The DSL looks like this: val rule = guild.createKeywordAutoModerationRule("name") { regexPattern("^b(a|@)d\$w(o|0)rd(s|$)") blockMessage() enabled = true } println(rule.regexPatterns) KeywordAutoModerationRuleBuilder.assignKeywords() was dropped and KeywordAutoModerationRuleBuilder.keywords was changed to var instead because it is no longer strictly required for creating rules. At least one of keywords or regexPatterns is required instead. The builder documentation was also updated to include the limits documented in #5504. see discord/discord-api-docs#5504
Also fixes some missing fields. See discord/discord-api-docs#5504.
Also fixes some missing fields. See discord/discord-api-docs#5504.
Draft PR for upcoming change to allow defining regex patterns in Automod rules with
trigger_type == KEYWORD
.This feature is not finalized yet and is still subject to change. This will be left as a Draft PR until then.