Skip to content
This repository has been archived by the owner on Oct 12, 2024. It is now read-only.

Commit

Permalink
deps: bump ProfanityCheckerAPI to v3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed Mar 19, 2024
1 parent 248fdad commit 9c717fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
dependencies {
api 'commons-io:commons-io:2.15.1'
api 'de.themoep:minedown-adventure:1.7.2-SNAPSHOT'
api 'net.william278:ProfanityCheckerAPI:2.0.1'
api 'net.william278:profanitycheckerapi:3.0'
api 'net.william278:desertwell:2.0.4'
api 'dev.vankka:mcdiscordreserializer:4.3.0'
api 'de.exlll:configlib-yaml:4.5.0'
Expand All @@ -19,7 +19,7 @@ dependencies {
compileOnly 'org.jetbrains:annotations:24.1.0'
compileOnly 'org.projectlombok:lombok:1.18.30'

testImplementation 'net.william278:ProfanityCheckerAPI:2.0.1'
testImplementation 'net.william278:profanitycheckerapi:3.0'
testImplementation 'net.kyori:adventure-api:4.15.0'

annotationProcessor 'org.projectlombok:lombok:1.18.30'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import lombok.Getter;
import net.william278.huskchat.user.OnlineUser;
import net.william278.profanitycheckerapi.ProfanityChecker;
import net.william278.profanitycheckerapi.ProfanityCheckerBuilder;
import org.jetbrains.annotations.NotNull;

/**
Expand All @@ -34,18 +33,19 @@
public class ProfanityFilterer extends ChatFilter {

@NotNull
private final ProfanityCheckerBuilder builder;
private final ProfanityChecker.ProfanityCheckerBuilder builder;

public ProfanityFilterer(@NotNull FilterSettings settings) {
super(settings);

final ProfanityFilterSettings profanitySettings = (ProfanityFilterSettings) settings;
this.builder = ProfanityChecker.builder();
if (profanitySettings.getLibraryPath() != null && !profanitySettings.getLibraryPath().isBlank()) {
builder.withLibraryPath(profanitySettings.getLibraryPath());
builder.libraryPath(profanitySettings.getLibraryPath());
}
if (profanitySettings.getMode() == ProfanityFilterMode.TOLERANCE) {
builder.withThresholdChecking(profanitySettings.getTolerance());
builder.useThreshold(true);
builder.threshold(profanitySettings.getTolerance());
}
initialize();
}
Expand Down

0 comments on commit 9c717fa

Please sign in to comment.