MessageFilter
MessageFilter
This plugin brings to you ability to control message in your chat provided from any source. You can hide annoying message of plugin (forever or using cooldown to display it), change any message to another. You can even use MessageFilter as translation tool for plugins that not provides translation mechanics by itself.
Video
Why I need this plugin?
- You would like to hide some spamming message print by plugin you use at your server;
- You would like to replace one message to another;
- You going to translate message of plugin but that plugin is not providing you language-file to edit;
Features
- Hiding messages
- Replacing messages
- Cooldown for message (for example, you don't like to lot of same message, and going to see only one of them during one minute)
- Regex (and other types of string comparison) supported
How it works
All rules added to MessageFilter store in files in "MessageFilter/rules" folder. You can add, modify or remove rules using command or by editing rule files.
Every rule base on some parameters:
- Type — defines the method which will used to determine text in message (before display it on screen). There are five types:
- EQUAL — case insensitive compare (Example: "Aaaa Bbbb" will be equal to "aaaa bbbb")
- CONTAINS — find substring in input-message
- START — check if message starts with provided text
- END — check if message ends with provided text
- REGEX — using regular expression to find matches
- message-mask — defines input mask, that will used to find matches in original message
- replace-to — defines replacement. Replacements supports placeholders %word1% ... %wordN% the will be replaced with conforming word from original message
- cooldown-time — time defined in format similar to time format used in ReActions plugin. Cooldown used to set up time-limit for displaying annoying message. For example, if cooldown time is set to 5 seconds. And "replace-to" mask is empty. Annoying message will displayed only once per five seconds.
When plugin (or other source) is sending message, this message is controlled by MessageFilter and changed according to defined rules. Player will see replaced message instead of original. This methods allows even to translate a plugins that not provides built-in translation for your language. You just need to find messages and create rules to replace it. Here is rule file example: http://dev.bukkit.org/bukkit-plugins/message-filter/pages/main/rule-file-example/
Commands
Main command of plugin is msgfilter (aliases: mfilter, filter).
- /msgfilter help — hmm... h
- /msgfilter add <RuleId> [GroupId] — create new rule
- /msgfilter set <RuleId> type|input|output|cooldown|group <Value> — set parameter (type, input mask, output mask, cooldown time or group) to <Value>
- /msgfilter remove <RuleId> — remove rule
- /msgfilter list [Mask] [PageNumber] — show list of rules
- /msgfilter info <RuleId> — display rule parameters
- /msgfilter save <GroupId> [<Number>|<Time>] — save message into file <GroupId>.yml.
- /msgfilter reload — reload rules
- /msgfilter test — test MessageFilter.
Creating rules
You can create new rules using: command line, incoming chat message and manully editing file.
Examples:
Using commands
- /msgfilter add newrule
- /msgfilter set newrule type EQUAL
- /msgfilter set newrule input this is the input message
- /msgfilter set newrule output &6this is the output message
Save incoming chat message
- /msgfilter save test1 — save next (only one) incoming message to file test1.yml
- /msgfilter save test2 15 — save next 15 incoming messages to file test1.yml
- /msgfilter save test2 10m — save all incoming messages during the 10 minutes to file test1.yml
Manual configuration
MessageFilter supports multiple rules definition files. It's a "YAML" fie (*.yml) located in "rules" folder. You can edit (or create new) this files manually. Here is example:
roadprotector: # rule Id type: EQUAL # rule type message-mask: '&3[RP] &cThis place is protected!' # incoming message (with color code) replace-to: '&6Здесь нельзя ломать и строить!' #outgoing (translated) message cooldown-time: '' # cooldown time use-formating: true # use formatting (colors) removejoing: # rule Id type: REGEX #rule type message-mask: '\w+ joined the server\.' # incoming message, I'm going to hide it replace-to: '' # Empty line cooldown-time: '' use-formating: false # ignore formatting annoying: type: EQUAL message-mask: 'You can\'t build here!' replace-to: '' # Empty line cooldown-time: '5s' #You will see this message only once during the five seconds use-formating: false # ignore formatting
MessageFilter self-test
You can use command /msgfilter test to be sure that MessageFilter works fine. Just type this command in chat. If you receive message "MessageFilter test failed!" usually you need to install or update ProtocolLib.
Permissions
- messagefilter.config — only one permission to access commands.
- messagefilter.test — perform test of MessageFilter when player joins the server.
Dependencies
This plugin requires ProtocoLib installed on your server.
Update checker
MessageFilter includes a update checker that use your server internet connection. Update checker will every hour check the dev.bukkit.org to find new released version of plugin and you can easy disable it: just set parameter "version-check" to "false" in config.yml.
@ratg97
Can you try instead of making "input" rule manualy try to "catch" it using /mfilter save command?
Sometime messages contain additional colors that you can not see. Or you can to disable color support for this rule.
http://gyazo.com/bbcd0d92ce8a350f07e0bf374a6bd61c not work
@ratg97 @YepImRobbie
MesageFilter do not working "WITH" any plugin. It works with MESSAGES that were sent to client.
Source of message (plugin, player or server) does not matter.
Any way. I tested MessageFilter with WorldGuard and it works.
How to check:
Type command /mfilter save wg 10s
During 10 second perform actions with WorldGuard
Check wg.yml file (in MessageFilter/rules)
you will find something like:
Edit rules and type command /mfilter reload
Enjoy :)
I really hate worldguard's messages, they're unclean and add such an unprofessional feel. Will this plugin eradicate them successfully?
@fromgate
but... can you test if it work with world guard?
@ratg97
MessageFilter is not "working with any plugin". It just catching the chat packet and send new one instead of it.
Try command /mfilter save to save chat message into rules files.
Example. Save all messages into file newrules.yml during next minute:
/mfilter save newrulres 1m
v0.3.0
World Guard not work with this
@fromgate
Thank you man, good work!
@AtracadorThe
Hello! I will update this plugin as soon as I can.
Please update! I really need this for my server, this plugin is the only thing holding me from updating to 1.8.3 :( UPDATE: Ok it works with 1.8.3 thanks anyways
@fromgate
Ey can u please update it to the latest spigot 1.8.3 it stops to works..check please..
I can't figure out how to remove part of a message. I have a plugin that produces messages like this: [s\r] O: Something something and I only wan't to remove the [s/r] O: part, not the Something something part, which does not have a fixed word count. How do I do that?
sr: type: START message-mask: '[s/r] O:' replace-to: '%word2% %word3% %word4% %word5%' cooldown-time: '' produces O:Something something %word4% %word5%
@arturek1666
What was original text?
Please try this text: '&6You can\'t build here'
Hi can you tell me why when I am putting the replace-to: '&6You can't build here' The text is white?
@Hawezo
Message "Your game mode has been updated" is shown client-side. Server did not sends this message to client, it just sends a new game mode state.
Wow. Just wow. This plugin is awesome. Just a question : is it normal that this plugin can't replace the bukkit's sentence : "Your game mode has been updated" ? Is it because of a craftbukkit restriction ? This is the only one thing I can't replace :/
This plugin is so useful, I love it \o/
@NoHoPeLess
How plugin must determine that one time your message must be replaced with one text, and in another time - with another text? It's a goal for more complex plugin and now I released new version of ReActions plugin that could be used as MessageFilter and MessageCommander replacement and supports large amount of additional conditions.
Video example of using ReActions for catching message in chat input and chat output:
@fromgate
Dont know xD
i thinking about START and END so that these determines...
Why can i change these two messages to different? or its impossible?
@NoHoPeLess If your message is always the same. How plugin could determine when message must be replaced with another?