-
Notifications
You must be signed in to change notification settings - Fork 8
Rules
The rules are based on operators (things like 'match', 'then deny', basically those, who tell the program what to do - they all are located in the header of rules.txt for your convenience). They consist of two parts: rules and handlers. Rules catch one single message using regular expressions, and handlers are basically group of actions a to you can assign a rule to, to avoid the need of writing instructions twice or more.
Here is an example of a rule that catches 'jerk', even in forms like jeeerrk and so on.
match \b(j+(\W|\d|_)*e+(\W|\d|_)*r+(\W|\d|_)*k+(\W|\d|_)*)
handle as swear
The 'match' operator needs a regular expression that is evaluated against players' messages. If it matches, the rule applies. The latter operator, 'handle as', tells the program to do all the actions stated in the 'swear' section in handlers.yml file (you can make operators to all of them separately in the rule itself, if you want).
That example above matches the word 'jerk' even if its obfuscated like jeeerk or j.e-r_k, and it will be handled as a 'swear' (this you can configure in handlers.yml file, and it should be self explanatory as there is very good documentation to this).
Below is an example of a filter which blocks the word "fuck" and is also immune to some bypasses like "f.u.c.k" and even "fuuu-ck". It is simple to configure it to match other words, too.
© MineAcademy | Code Unique Minecraft Plugins & Servers In 20 Days
About
Free version
Basics
Understanding
- Channels
- Formatting
- Rules / Filters
- Handlers
- Groups
- JSON
- Discord
- Toggle ignoring swears
- Variables
- JavaScript Variables
Tweaking
Solving Issues
Miscellaneous