mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 22:15:45 +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.
|
# towny-town only works when the CarbonChatTowny addon is installed.
|
||||||
# Requires both players to be in the same town to see the message.
|
# Requires both players to be in the same town to see the message.
|
||||||
towny-town: false
|
towny-town: false
|
||||||
|
# filter only works when CarbonChatModeration is installed.
|
||||||
|
# Modifies / prevents messages depending on how filters are setup.
|
||||||
|
filter: true
|
||||||
color: '#FFFFFF'
|
color: '#FFFFFF'
|
||||||
# Can players /toggle this channel and hide its messages?
|
# Can players /toggle this channel and hide its messages?
|
||||||
ignorable: true
|
ignorable: true
|
||||||
|
|||||||
+2
-2
@@ -50,9 +50,9 @@ public class FilterHandler implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean channelUsesFilter(ChatChannel chatChannel) {
|
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.
|
# Anything in blocked-words will prevent the message from being sent at all.
|
||||||
blocked-words:
|
blocked-words:
|
||||||
- "pineapple doesn't belong on pizza"
|
- "pineapple doesn't belong on pizza"
|
||||||
channels:
|
|
||||||
- '*' # Use '*' to mean all channels
|
|
||||||
|
|
||||||
clear-chat:
|
clear-chat:
|
||||||
# The message sent to clear chat, you probably want to leave this blank
|
# The message sent to clear chat, you probably want to leave this blank
|
||||||
|
|||||||
Reference in new issue
Block a user