mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Use context for filter instead of moderation option
This commit is contained in:
1 parent
88af664e61
commit
f22003b6e0
3 files changed
+5
-4
No files matched your search
@@ -33,6 +33,9 @@ default:
|
||||
# towny-town only works when the CarbonChatTowny addon is installed.
|
||||
# Requires both players to be in the same town to see the message.
|
||||
towny-town: false
|
||||
# filter only works when CarbonChatModeration is installed.
|
||||
# Modifies / prevents messages depending on how filters are setup.
|
||||
filter: true
|
||||
color: '#FFFFFF'
|
||||
# Can players /toggle this channel and hide its messages?
|
||||
ignorable: true
|
||||
|
||||
+2
-2
@@ -50,9 +50,9 @@ public class FilterHandler implements Listener {
|
||||
}
|
||||
|
||||
private boolean channelUsesFilter(ChatChannel chatChannel) {
|
||||
List<String> channels = moderation.getConfig().getStringList("filters.channels");
|
||||
Object filter = chatChannel.getContext("filter");
|
||||
|
||||
return channels.contains("*") || channels.contains(chatChannel.getKey());
|
||||
return filter instanceof Boolean && ((Boolean) filter);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,8 +18,6 @@ filters:
|
||||
# Anything in blocked-words will prevent the message from being sent at all.
|
||||
blocked-words:
|
||||
- "pineapple doesn't belong on pizza"
|
||||
channels:
|
||||
- '*' # Use '*' to mean all channels
|
||||
|
||||
clear-chat:
|
||||
# The message sent to clear chat, you probably want to leave this blank
|
||||
|
||||
Reference in new issue
Block a user