# -------------------------------------------------------------------------------
# This is the implementation of ChatControl's rule engine codenamed ChatCeaser
#
# It accepts following operators (The <> is the parameter you'll specify)
# match <regex> (A valid regular expression to match player's message.)
# id <number/string> (Assign an id/name to the rule. Used in messages and handlers.)
# ignore string <string/regex> (If the message matches the given string it will be ignored.)
# ignore event <chat/commands/signs> (If the rule triggers on specified event it will be ignored.)
# ignore perm <permission> (A permission to bypass the rule.)
# ignore gamemode <survival/creative/adventure/spectator/0/1/2/3> (Gamemodes to be ignored. Separate by | to add multiple values.)
# before strip <regex> (A regular expression used to strip specified characters before the message is checked.)
# before replace <regex> with <message> (A regular expression to replace characters with other characters before the message check.)
# then replace <replacement|replacement2> (A string that replaces only the part of the checked message that matches the match.)
#                                         (Chosen randomly from the messages divided by |)
# then rewrite <message|message2> (A message that replaces the entire checked message.)
#                                         (Chosen randomly from the messages divided by |)
# then deny (Cancel the player's message from appearing. See settinsg.yml for configuration on specific events.)
# then console <command|command2|command3> (Commands to execute as the console. Use {player} to get player's name. Split multiple commands by |)
# then warn <message> (A message sent to the player.)
# then kick <optionalResaon> (Kick the player with an optional message.)
# then notify <permission> <message> (Send a message to all players with the permission.)
# then fine <amount> (If Vault is installed - take specified amount of money from the player.)
# then log (Caught message will be printed in console and saved in logs/rules.txt)
# handle as <handler_name> (Launch actions specified in handlers.yml. NOTICE: This must be as a last operator in the rule!)
#
# Valid variables:
# {player} (Player's name. Without prefix and suffix.)
# {world} (Player's world.)
#
# Supports color codes with '&' character.
# Accepts unicode characters when saved in UTF-8 encoding (tested on Notepad++).
# -------------------------------------------------------------------------------

# IP filter. 
# (Notice the operator strip which removes specified characters BEFORE the message is checked.)
match \b[0-9]{1,3}(\.|dot|\(dot\)|-|;|:|,|(\W|\d|_)*\s)+[0-9]{1,3}(\.|dot|\(dot\)|-|;|:|,|(\W|\d|_)*\s)+[0-9]{1,3}(\.|dot|\(dot\)|-|;|:|,|(\W|\d|_)*\s)+[0-9]{1,3}\b
id 1
before replace dot|\[|\]|\{|\}|\(|\) with .
before strip [\(\[\]\)]
handle as advertisement

# Domain/URL filter.
# You can add new domains by inserting '|your_domain' after '|io' (e.g. '|io|pl' for also blocking '.pl' domains)
match [a-zA-Z0-9\-\.]+\s?(\.|dot|\(dot\)|-|;|:|,)\s?(com|org|net|cz|co|uk|sk|biz|mobi|xxx|eu|me|io)\b
# If you want to whitelist your server, it is only necessary to add it once in format:
# website.domain (example: procraft.com)
# To add more domains simply add them after the last one and divide by |
ignore string minecraft:|youtube.com|imgur.com
id 2
before replace dot|\[|\]|\{|\}|\(|\) with .
before strip [\(\[\]\)]
handle as advertisement

# Bitch filter - commented out just to show you example of usage. It is filtered in more advanced way below.
#match \bb(i|!)tch
#id 3
#then warn Watch your language please.
# #Before commenting out check if you have Points enabled in settings.yml
#then points swear 1
#then notify chatcontrol.notify.rulesalert &8[&7{ruleID}&8] &7{player}: &f{message}
#then replace fridge|bridge

# Ass and asshole filter. Words like glass are ignored. Commented out since its filtered below.
#match \bass\b|\basshole
#handle as swear

# Swastika filter
match \u534D|\u5350
then kick &cDisallowed characters in the chat
then notify chatcontrol.notify.rulesalert &8[&7Swastika&8] &7{player}: &f{message}
then deny

# -------------------------------------------------------------------------------
# Predefined swear filters are found below, in courtesy of owenmaple.
# Editing them requires basic knowledge of regular expression language.
# See ChatControl's Wiki on Github for starting help (with pictures).
# -------------------------------------------------------------------------------
# All rules can safely be removed (or edited, if you are familiar with regex!)
# -------------------------------------------------------------------------------

# Blocks fuck
match \b(f+(\W|\d|_)*u+(\W|\d|_)*c+(\W|\d|_)*k+(\W|\d|_)*)
handle as swear

# Blocks 'horny'
match \b(h+(\W|\d|_)*o+(\W|\d|_)*r+(\W|\d|_)*n+(\W|\d|_)*y+(\W|\d|_)*)
handle as swear

# Blocks 'aroused'
match \b(a+(\W|\d|_)*r+(\W|\d|_)*o+(\W|\d|_)*u+(\W|\d|_)*s+(\W|\d|_)*e+(\W|\d|_)*d+(\W|\d|_)*)
handle as swear

# Blocks 'hentai'
match \b(h+(\W|\d|_)*e+(\W|\d|_)*n+(\W|\d|_)*t+(\W|\d|_)*a+(\W|\d|_)*i+(\W|\d|_)*)
handle as swear

# Blocks 'slut'
match \b(s+(\W|\d|_)*l+(\W|\d|_)*u+(\W|\d|_)*t+(\W|\d|_)*)
handle as swear

# Blocks 'slag'
match \b(s+(\W|\d|_)*l+(\W|\d|_)*a+(\W|\d|_)*g+(\W|\d|_)*)
handle as swear

# Blocks 'boob'
match \b(b+(\W|\d|_)*o+(\W|\d|_)*o+(\W|\d|_)*b+(\W|\d|_)*)
handle as swear

# Blocks 'pussy'
match \b(p+(\W|\d|_)*u+(\W|\d|_)*s+(\W|\d|_)*s+(\W|\d|_)*y+(\W|\d|_)*)
handle as swear

# Blocks 'vagina'
match \b(v+(\W|\d|_)*a+(\W|\d|_)*g+(\W|\d|_)*i+(\W|\d|_)*n+(\W|\d|_)*a+(\W|\d|_)*)
handle as swear

# Blocks 'faggot'
match \b(f+(\W|\d|_)*a+(\W|\d|_)*g+(\W|\d|_)*g+(\W|\d|_)*o+(\W|\d|_)*t+(\W|\d|_)*) 
handle as swear

# Blocks 'bugger'
match \b(b+(\W|\d|_)*u+(\W|\d|_)*g+(\W|\d|_)*g+(\W|\d|_)*e+(\W|\d|_)*r+(\W|\d|_)*)
handle as swear

# Blocks 'bastard'
match \b(b+(\W|\d|_)*a+(\W|\d|_)*s+(\W|\d|_)*t+(\W|\d|_)*a+(\W|\d|_)*r+(\W|\d|_)*d+(\W|\d|_)*)
handle as swear

# Blocks 'cunt'
match \b(c+(\W|\d|_)*u+(\W|\d|_)*n+(\W|\d|_)*t+(\W|\d|_)*)
handle as swear

# Blocks 'nigga'
match \b(n+(\W|\d|_)*i+(\W|\d|_)*g+(\W|\d|_)*g+(\W|\d|_)*a+(\W|\d|_)*)
handle as swear

# Blocks 'nigger'
match \b(n+(\W|\d|_)*i+(\W|\d|_)*g+(\W|\d|_)*g+(\W|\d|_)*e+(\W|\d|_)*r+(\W|\d|_)*)
handle as swear

# Blocks 'jerk'
match \b(j+(\W|\d|_)*e+(\W|\d|_)*r+(\W|\d|_)*k+(\W|\d|_)*)
handle as swear

# Blocks 'anal'
match \b(a+(\W|\d|_)*n+(\W|\d|_)*a+(\W|\d|_)*l+(\W|\d|_)*)
ignore string analog|an all
handle as swear

# Blocks 'wanker'
match \b(w+(\W|\d|_)*a+(\W|\d|_)*n+(\W|\d|_)*k+(\W|\d|_)*e+(\W|\d|_)*r+(\W|\d|_)*)
handle as swear

# Blocks 'tosser'
match \b(t+(\W|\d|_)*o+(\W|\d|_)*s+(\W|\d|_)*s+(\W|\d|_)*e+(\W|\d|_)*r+(\W|\d|_)*)
handle as swear

# Blocks 'shit'
match \b(s+(\W|\d|_)*h+(\W|\d|_)*i+(\W|\d|_)*t+(\W|\d|_)*)
handle as swear

# Blocks 'rape'
match \b(r+(\W|\d|_)*a+(\W|\d|_)*p+(\W|\d|_)*e+(\W|\d|_)*)
handle as swear

# Blocks 'rapist'
match \b(r+(\W|\d|_)*a+(\W|\d|_)*p+(\W|\d|_)*i+(\W|\d|_)*s+(\W|\d|_)*t+(\W|\d|_)*)
handle as swear

# Blocks 'dick'
match \b(d+(\W|\d|_)*i+(\W|\d|_)*c+(\W|\d|_)*k+(\W|\d|_)*)
handle as swear

# Blocks 'cock'
match \b(c+(\W|\d|_)*o+(\W|\d|_)*c+(\W|\d|_)*k+(\W|\d|_)*)
handle as swear

# Blocks 'whore'
match \b(w+(\W|\d|_)*h+(\W|\d|_)*o+(\W|\d|_)*r+(\W|\d|_)*e+(\W|\d|_)*)
handle as swear

# Blocks 'bitch'
match \b(b+(\W|\d|_)*i+(\W|\d|_)*t+(\W|\d|_)*c+(\W|\d|_)*h+(\W|\d|_)*)
handle as swear

# Blocks 'asshole'
match \b(a+(\W|\d|_)*s+(\W|\d|_)*s+(\W|\d|_)*h+(\W|\d|_)*o+(\W|\d|_)*l+(\W|\d|_)*e+(\W|\d|_)*)
handle as swear

# Blocks 'twat'
match \b(t+(\W|\d|_)*w+(\W|\d|_)*a+(\W|\d|_)*t+(\W|\d|_)*)
handle as swear

# Blocks 'titt'
match \b(t+(\W|\d|_)*i+(\W|\d|_)*t+(\W|\d|_)*(t|s)+(\W|\d|_)*)
handle as swear

# Blocks 'piss'
match \b(p+(\W|\d|_)*i+(\W|\d|_)*s+(\W|\d|_)*s+(\W|\d|_)*)
handle as swear

# Blocks 'intercourse'
match \b(i+(\W|\d|_)*n+(\W|\d|_)*t+(\W|\d|_)*e+(\W|\d|_)*r+(\W|\d|_)*c+(\W|\d|_)*o+(\W|\d|_)*u+(\W|\d|_)*r+(\W|\d|_)*s+(\W|\d|_)*e+(\W|\d|_)*)
handle as swear

# Blocks 'sperm'
match \b(s+(\W|\d|_)*p+(\W|\d|_)*e+(\W|\d|_)*r+(\W|\d|_)*m+(\W|\d|_)*) 
handle as swear

# Blocks 'spunk'
match \b(s+(\W|\d|_)*p+(\W|\d|_)*u+(\W|\d|_)*n+(\W|\d|_)*k+(\W|\d|_)*) 
handle as swear

# Blocks 'testicle'
match \b(t+(\W|\d|_)*e+(\W|\d|_)*s+(\W|\d|_)*t+(\W|\d|_)*i+(\W|\d|_)*c+(\W|\d|_)*l+(\W|\d|_)*e+(\W|\d|_)*) 
handle as swear

# Blocks 'milf'
match \b(m+(\W|\d|_)*i+(\W|\d|_)*l+(\W|\d|_)*f+(\W|\d|_)*) 
handle as swear

# Blocks 'retard'
match \b(r+(\W|\d|_)*e+(\W|\d|_)*t+(\W|\d|_)*a+(\W|\d|_)*r+(\W|\d|_)*d+(\W|\d|_)*) 
handle as swear

# Blocks 'anus'
match \b(a+(\W|\d|_)*n+(\W|\d|_)*u+(\W|\d|_)*s+(\W|\d|_)*) 
handle as swear

# Blocks 'dafuq'
match \b(d+(\W|\d|_)*a+(\W|\d|_)*f+(\W|\d|_)*u+(\W|\d|_)*q+(\W|\d|_)*) 
handle as swear

# ---------------- Following rules are commented out. Remove # to enable them ----------------

# Blocks 'sex'
#match \b(s+(\W|\d|_)*e+(\W|\d|_)*x+(\W|\d|_)*)
#handle as swear

# Blocks 'gay'
#match \b(g+(\W|\d|_)*a+(\W|\d|_)*y+(\W|\d|_)*)
#handle as swear

# Blocks 'lesbian'
#match \b(l+(\W|\d|_)*e+(\W|\d|_)*s+(\W|\d|_)*b+(\W|\d|_)*i+(\W|\d|_)*a+(\W|\d|_)*n+(\W|\d|_)*)
#handle as swear

# Blocks 'homo'
#match \b(h+(\W|\d|_)*o+(\W|\d|_)*m+(\W|\d|_)*o+(\W|\d|_)*)
#handle as swear

# Blocks 'homosexual'
#match \b(h+(\W|\d|_)*o+(\W|\d|_)*m+(\W|\d|_)*o+(\W|\d|_)*s+(\W|\d|_)*e+(\W|\d|_)*x+(\W|\d|_)*u+(\W|\d|_)*a+(\W|\d|_)*l+(\W|\d|_)*)
#handle as swear

# Blocks 'cum'
#match \b(c+(\W|\d|_)*u+(\W|\d|_)*m+(\W|\d|_)*) 
#handle as swear

# Blocks 'prostitute'
#match \b(p+(\W|\d|_)*r+(\W|\d|_)*o+(\W|\d|_)*s+(\W|\d|_)*t+(\W|\d|_)*i+(\W|\d|_)*t+(\W|\d|_)*u+(\W|\d|_)*t+(\W|\d|_)*e+(\W|\d|_)*) 
#handle as swear

# Blocks 'wtf'
#match \b(w+(\W|\d|_)*t+(\W|\d|_)*f+(\W|\d|_)*) 
#handle as swear

# Blocks 'penis'
#match \b(p+(\W|\d|_)*e+(\W|\d|_)*n+(\W|\d|_)*i+(\W|\d|_)*s+(\W|\d|_)*)
#handle as swear

# Blocks 'ffs'
#match \b(f+(\W|\d|_)*f+(\W|\d|_)*s+(\W|\d|_)*) 
#handle as swear

# Blocks 'pedo'
#match \b(p+(\W|\d|_)*e+(\W|\d|_)*d+(\W|\d|_)*o+(\W|\d|_)*) 
#handle as swear