[AB-84] adding profanity filter with different feature modes

react command: adding additional mapping for character r
This commit is contained in:
Sheldan
2021-05-16 23:44:50 +02:00
parent eca9e6ebf7
commit 04a7cfafd7
53 changed files with 2875 additions and 34 deletions

View File

@@ -4,6 +4,7 @@ import dev.sheldan.abstracto.core.utils.MessageUtils;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
import net.dv8tion.jda.api.entities.Message;
@Getter
@Setter
@@ -16,4 +17,13 @@ public class ServerChannelMessage {
public String getJumpUrl() {
return MessageUtils.buildMessageUrl(serverId, channelId, messageId);
}
public static ServerChannelMessage fromMessage(Message message) {
return ServerChannelMessage
.builder()
.serverId(message.getGuild().getIdLong())
.channelId(message.getChannel().getIdLong())
.messageId(message.getIdLong())
.build();
}
}

View File

@@ -3,11 +3,14 @@ package dev.sheldan.abstracto.core.service;
import dev.sheldan.abstracto.core.models.database.ProfanityGroup;
import dev.sheldan.abstracto.core.models.database.ProfanityRegex;
import java.util.Optional;
public interface ProfanityService {
String replaceProfanities(String input, Long serverId);
String replaceProfanities(String input, Long serverId, String replacement);
String replaceProfanitiesWithDefault(String input, Long serverId, String replacement);
boolean containsProfanity(String input, Long serverId);
Optional<ProfanityRegex> getProfanityRegex(String input, Long serverId);
ProfanityGroup createProfanityGroup(Long serverId, String profanityGroupName);
void deleteProfanityGroup(Long serverId, String profanityGroupName);
void deleteProfanityRegex(Long serverId, String profanityGroupName, String profanityRegexName);

View File

@@ -11,6 +11,8 @@ public interface ProfanityGroupManagementService {
List<ProfanityGroup> getAllForServer(Long serverId);
ProfanityGroup createProfanityGroup(AServer server, String name);
boolean doesProfanityGroupExist(AServer server, String name);
Optional<ProfanityGroup> getProfanityGroupByIdOptional(Long profanityGroupId);
ProfanityGroup getProfanityGroupById(Long profanityGroupId);
Optional<ProfanityGroup> getProfanityGroupOptional(AServer server, String name);
ProfanityGroup getProfanityGroup(AServer server, String name);
void deleteProfanityGroup(ProfanityGroup profanityGroup);

View File

@@ -12,4 +12,6 @@ public interface ProfanityRegexManagementService {
void deleteProfanityRegex(ProfanityGroup group, String profanityName);
boolean doesProfanityRegexExist(ProfanityGroup profanityGroup, String name);
Optional<ProfanityRegex> getProfanityRegexOptional(ProfanityGroup profanityGroup, String name);
Optional<ProfanityRegex> getProfanityRegexViaIdOptional(Long profanityRegexId);
ProfanityRegex getProfanityRegexViaId(Long profanityRegexId);
}