mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 06:28:53 +00:00
Add blocked words
This commit is contained in:
1 parent
6f1b719e44
commit
50bb994688
2 files changed
+8
No files matched your search
+6
@@ -30,6 +30,12 @@ public class FilterHandler implements Listener {
|
|||||||
event.setMessage(event.getMessage().replaceAll(entry, filterText));
|
event.setMessage(event.getMessage().replaceAll(entry, filterText));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (channelUsesFilter(event.getChannel())) {
|
||||||
|
for (String entry : moderation.getConfig().getStringList("filters.blocked-words")) {
|
||||||
|
event.setMessage(event.getMessage().replaceAll(entry, ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean channelUsesFilter(ChatChannel chatChannel) {
|
private boolean channelUsesFilter(ChatChannel chatChannel) {
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ filters:
|
|||||||
filtered-words:
|
filtered-words:
|
||||||
- 'lag'
|
- 'lag'
|
||||||
- 'la[g]+'
|
- 'la[g]+'
|
||||||
|
blocked-words:
|
||||||
|
- 'broccoli sucks'
|
||||||
channels:
|
channels:
|
||||||
- '*' # Use '*' to mean all channels
|
- '*' # Use '*' to mean all channels
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user