diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..629309fc3c158ba94ef7612c55dded7b2296c655 --- /dev/null +++ b/README.md @@ -0,0 +1,33 @@ +# SimpleChatFilter +A simple chat filter for Bungeecord servers. + +## Permissions +* `simplechatfilter.bypass.<category>` - Bypass the chat filter for the category. +* `simplechatfilter.bypass.*` - Bypass the chat filter entirely. +* `simplechatfilter.staff` - See staff message when a player breaches the chat filter. + +## Configuration +```yaml +# The list of categories to be filtered. +# Place the categories in order of severity, highest first. +# Only the most severe category will be applied to a message. +categories: + # A category name + # Can be anything you want + advertising-pfcloud: + # Blocked phrases + # These are case-insensitive. + # If the message contains any of these, it will be blocked. + blocked: + - a friendly bot designed to join servers + - If you are searching for a good server hosting provider + - https://shop.pfcloud.io + # The commands to run when a message is blocked. Use {username} for the offending player's username. + commands: + - ipban {username} Bot/Advertising -s + # A message to send to the player when their message is blocked. + message: '&cPlease do not advertise!' + +# The message to send to staff when a player breaches the chat filter. +staff-message: '&a[ChatFilter] &c{username} &7 broke rule &c{category} &7on server &c{server}&7.' +``` \ No newline at end of file diff --git a/src/main/java/net/dappergoose/simplechatfilter/SimpleChatFilter.java b/src/main/java/net/dappergoose/simplechatfilter/SimpleChatFilter.java index a44331738d543b4133aa939f21908a04db05a49d..f2ce6a9ffc8cbe155f6a9658538541c33efe917b 100644 --- a/src/main/java/net/dappergoose/simplechatfilter/SimpleChatFilter.java +++ b/src/main/java/net/dappergoose/simplechatfilter/SimpleChatFilter.java @@ -95,7 +95,7 @@ public final class SimpleChatFilter extends Plugin implements Listener { ) )); for(String command : pluginConfig.getStringList("categories." + matchedCategory + ".commands")) { - getProxy().getPluginManager().dispatchCommand(getProxy().getConsole(), command.replace("{player}", p.getName())); + getProxy().getPluginManager().dispatchCommand(getProxy().getConsole(), command.replace("{username}", p.getName())); } } }