Skip to content
Snippets Groups Projects
Verified Commit c46974e7 authored by TheJoeCoder's avatar TheJoeCoder
Browse files

Add README and fix bug


Signed-off-by: default avatarTheJoeCoder <joe@radialbog9.uk>
parent a3c95d4d
Branches
No related tags found
No related merge requests found
Pipeline #41 canceled
# 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
......@@ -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()));
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment