mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-05 00:53:04 +00:00
[AB-xxx] making regex checks ignore case
This commit is contained in:
@@ -40,7 +40,7 @@ import java.util.stream.Collectors;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class MessageEmbedServiceBean implements MessageEmbedService {
|
public class MessageEmbedServiceBean implements MessageEmbedService {
|
||||||
|
|
||||||
private final Pattern messageRegex = Pattern.compile("(?<whole>(?:https?://)?(?:\\w+\\.)?discord(?:app)?\\.com/channels/(?<server>\\d+)/(?<channel>\\d+)/(?<message>\\d+)(?:.*?))+");
|
private final Pattern messageRegex = Pattern.compile("(?<whole>(?:https?://)?(?:\\w+\\.)?discord(?:app)?\\.com/channels/(?<server>\\d+)/(?<channel>\\d+)/(?<message>\\d+)(?:.*?))+", Pattern.CASE_INSENSITIVE);
|
||||||
|
|
||||||
public static final String MESSAGE_EMBED_TEMPLATE = "message_embed";
|
public static final String MESSAGE_EMBED_TEMPLATE = "message_embed";
|
||||||
public static final String REMOVAL_EMOTE = "removeEmbed";
|
public static final String REMOVAL_EMOTE = "removeEmbed";
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ public class ProfanityServiceBean implements ProfanityService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void loadProfanityRegex(ProfanityRegex profanityRegex, Long serverId) {
|
private void loadProfanityRegex(ProfanityRegex profanityRegex, Long serverId) {
|
||||||
Pattern pattern = Pattern.compile(profanityRegex.getRegex());
|
Pattern pattern = Pattern.compile(profanityRegex.getRegex(), Pattern.CASE_INSENSITIVE);
|
||||||
List<PatternReplacement> newPatterns = new ArrayList<>();
|
List<PatternReplacement> newPatterns = new ArrayList<>();
|
||||||
PatternReplacement patternReplacement = PatternReplacement
|
PatternReplacement patternReplacement = PatternReplacement
|
||||||
.builder()
|
.builder()
|
||||||
|
|||||||
Reference in New Issue
Block a user