Skip to content

Commit

Permalink
fix: respond to filter text only once
Browse files Browse the repository at this point in the history
  • Loading branch information
70CentsApple committed Jun 22, 2024
1 parent 20bafdb commit b8c23d8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public static boolean shouldWork(Text text) {
if (!(boolean) ChatTools.CONFIG.get("filter.Enabled")) {
return false;
}
// only respond once
if (TextUtils.wash(text.getString())
.contains(TextUtils.wash(TextUtils.trans("texts.filterPlaceholder").getString()))) {
return false;
}
List<String> filterList = (List<String>) ChatTools.CONFIG.get("filter.List");
String washed = TextUtils.wash(text.getString());
for (String pattern : filterList) {
Expand Down

0 comments on commit b8c23d8

Please sign in to comment.