[AutoMod]: Do not sanitize input passed to Regex rules #6444
-
Multiple server owners, including myself, have noticed that when using Regexes for custom AutoMod rules, strange behavior occurs, most notably causing issues with the I assume the sanitizing is done to break common workarounds for AutoMod such as cramming lots of special/whitespace characters into your offending message, which is great for Discord's built-in rules and manual word blacklists, but really hurts effective usage of Regex for even common AutoMod needs. A simple example that comes to mind is filtering the new header Markdown:
This will fail on any subsequent lines after the first, as any newlines are replaced with either "nothing" or a space. The following message will evade this rule: I have now
# evaded AutoMod >:) It would be a nice consideration to pass the raw message content to AutoMod for Regexes only, if possible. At the moment, server owners have to implement more aggressive AutoMod rules which are more prone to false positives. I'm sure others who have experienced issues like this can chime in with other problems they've experienced when using Regex with AutoMod. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I'm in favor of this or some kind of special regex flag accepted by Discord's automod to disable the pre-processing, maybe something like (?-p) |
Beta Was this translation helpful? Give feedback.
-
the content gets analyzed with different levels of sanitization, including a "raw" level where there is almost no sanitization (it still does a small baseline amount of transformations though). this raw level still wasn't preserving newlines, which i think was the main issue here. If so I think this issue should be fixed now, let me know if you still notice a problem. |
Beta Was this translation helpful? Give feedback.
the content gets analyzed with different levels of sanitization, including a "raw" level where there is almost no sanitization (it still does a small baseline amount of transformations though). this raw level still wasn't preserving newlines, which i think was the main issue here. If so I think this issue should be fixed now, let me know if you still notice a problem.