Message Filtering - PantherMan594/BungeeEssentials GitHub Wiki

Levenshtein Distance

As of version 1.0.6, BungeeEssentials implements a very basic antispam feature which calculates the levenshtein distance of the current message and previous message, this helps to prevent spam as messages that are considered to be an 85% match or higher will be blocked and the player will be presented a message asking them not to spam.

Unfortunately this makes mass messaging a pain, though it is a trade off for having the functionality there. You can bypass the filter by granting yourself the appropriate permission from the permissions page.

You can disable this feature by removing spam from your enable list. Find out more on the modules page.

Regular Expressions

As of version 1.0.8a, BungeeEssentials implements a basic regex matching system where you can setup "rules" (inspired by the likes of ChatControl and PwnFilter) to determine if a message should be blocked or not.

You can also bypass this filter by granting the appropriate permission from the permissions page.

You can disable this feature by removing rules from your enable list. Find out more on the modules page.


By default BungeeEssentials includes several expressions, though these are mainly for demonstration purposes and I can't promise that they are amazingly reliable (I'm not an expression god, sorry!)

rules:
- pattern: \bfuck\b
  handle: CURSING
- pattern: \b(([\w\d]{2,})\s*.(\.|d.t).{0,5})+(net|com|xyz|me|org|site|pw|top|io|co|biz|eu|uk)\b
  handle: ADVERTISEMENT
- pattern: \b(([\w\d]{2,})\s*.(\.|dot).{0,5})+(net|com|xyz|me|org|site|pw|top|io|co|biz|eu|uk)
  handle: ADVERTISEMENT
- pattern: \b.+((\.|dot).+)*(\.|dot)[^\s]*[a-zA-Z]{2,5}
  handle: ADVERTISEMENT
- pattern: (\d{1,4}\.){3}\d{1,4}
  handle: ADVERTISEMENT
- pattern: asshole
  handle: REPLACE
  replacement: '******'
- pattern: I hate (this|your) server
  handle: REPLACE
  replacement: I love this server
- pattern: I hate (this|your) server
  handle: COMMAND
  command: send {{ SENDER }} lobby

For those of you who do not understand regular expressions, rules 2-5 block hyperlinks and attempts to also block IPv4 addresses.

Handlers

There are 4 handlers available as of version 2.1.0, they are listed below:

  • ADVERTISEMENT
  • CURSING
  • REPLACE
  • COMMAND

Replacement offers you the ability to replace the matched text with text of your choice, you can see an example of this above.

The ADVERTISEMENT handler will warn a player with whatever you have specified in the configuration file and the CURSING handler will also warn the player with whatever you have specified in the configuration file.

Command runs a command whenever the matched text is said, which can be used to deal punishments or notify staff.

Banned Words

Banned words allows a server owner to easily ban words (hence the name) by simply adding it to a list of words, no regex knowledge needed. Whenever any of those words or variations of them (asdf, asssddf, as_dd_f, etc will be blocked with the word "asdf") are said in a chat or message, they will be replaced with the replacement string (configurable).

Warnings

By default the configuration file comes loaded with three warnings as displayed below, these can be adjusted as you wish and global variables may be used should you wish to use them.

warnings:
    similarity: '&cPlease do not spam other players!'
    swearing: '&cPlease do not swear at other players!'
    advertising: '&cPlease do not advertise other servers!'

Logging

As of version 1.0.8a, BungeeEssentials implements a chat logging feature, which will log which rules a player breaks to plugins/BungeeEssentials/chat/chat.log