Improved regex support for automod discord servers
Currently discord uses the native Rust language engine to handle regexes in the auto-mod, however, the regexes provided natively in rust are far from complete especially with the lack of backreference which can be extremely useful for the automatic moderation.
Take for example this regex: `(.+\B)\s+(\1(\s+)?)+` its purpose is to allow the detection of duplication of text in a message (several times the same word, or even phrase repeat)
you can see its usage in [regex101](https://regex101.com/r/n6tNhk/2)
However, this regex uses backreferences (`\1`) to work, which is not compatible with Rust's native engine in regex processing and therefore prevents self-moderation from being applied to all of the content that may be necessary (in particular to prevent spam)
There is a way in Rust to access the missing regex functions according to this documentation page:
https://docs.rs/fancy-regex/latest/fancy_regex/
I don't know to what extent this would hurt performance, but using the classic engine for supported regex and the latter for more advanced regex might be a good compromise in overall server security.
-
To enable it go into Server Settings > AutoMod > (toggle one) Enforce Server Rules. NGS Medicare
-1
댓글을 남기려면 로그인하세요.
댓글
댓글 1개