Merge remote-tracking branch 'origin/experimental' into experimental
# Conflicts: # src/main/java/io/github/thetrouper/sentinel/Sentinel.java # src/main/java/io/github/thetrouper/sentinel/cmds/SentinelCommand.java # src/main/java/io/github/thetrouper/sentinel/server/NewAction.java
This commit is contained in:
7
build.sh
7
build.sh
@@ -8,9 +8,8 @@ if [ $? -eq 0 ]; then
|
|||||||
echo "Gradle build successful."
|
echo "Gradle build successful."
|
||||||
|
|
||||||
# SFTP upload
|
# SFTP upload
|
||||||
SFTP_HOST="192.168.1.199"
|
SFTP_HOST="server"
|
||||||
SFTP_USER="trouper"
|
SFTP_USER="trouper"
|
||||||
SFTP_PASSWORD="Trouper12()1"
|
|
||||||
SFTP_REMOTE_DIR="/home/trouper/docker/data/plugins/"
|
SFTP_REMOTE_DIR="/home/trouper/docker/data/plugins/"
|
||||||
|
|
||||||
# Create a temporary file with a unique name
|
# Create a temporary file with a unique name
|
||||||
@@ -24,9 +23,7 @@ if [ $? -eq 0 ]; then
|
|||||||
echo "bye" >> "$TEMP_FILE"
|
echo "bye" >> "$TEMP_FILE"
|
||||||
|
|
||||||
# Use sftp non-interactively with the specified commands
|
# Use sftp non-interactively with the specified commands
|
||||||
sftp -oStrictHostKeyChecking=no -oBatchMode=no -b "$TEMP_FILE" "$SFTP_USER@$SFTP_HOST" <<EOF
|
sftp -oStrictHostKeyChecking=no -oBatchMode=no -b "$TEMP_FILE" "$SFTP_USER@$SFTP_HOST"
|
||||||
$SFTP_PASSWORD
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Remove the temporary file
|
# Remove the temporary file
|
||||||
rm -f "$TEMP_FILE"
|
rm -f "$TEMP_FILE"
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package io.github.thetrouper.sentinel.data;
|
||||||
|
|
||||||
|
import org.bukkit.event.Cancellable;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
public record ActionResult(String name, Runnable action, boolean isRan) {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
package io.github.thetrouper.sentinel.data;
|
|
||||||
|
|
||||||
import io.github.thetrouper.sentinel.Sentinel;
|
|
||||||
|
|
||||||
public enum FAT {
|
|
||||||
BLOCK_SWEAR("Sentinel Profanity Filter",null,"swear-block-warn", "swear-block-notification", null,0x000000),
|
|
||||||
BLOCK_SPAM("Sentinel Anti-Spam", null, "spam-block-warn", "spam-notification",null,0x000000),
|
|
||||||
SWEAR_PUNISH("Sentinel Anti-Swear Log","Anti-Swear", "profanity-mute-warn", "profanity-mute-notification", Sentinel.mainConfig.chat.antiSwear.swearPunishCommand, 0xFFB000),
|
|
||||||
SLUR_PUNISH("Sentinel Anti-Slur Log", "Anti-Slur", "slur-mute-warn", "slur-mute-notification", Sentinel.mainConfig.chat.antiSwear.strictPunishCommand, 0xFF0000),
|
|
||||||
SPAM_PUNISH("Sentinel Anti-Spam Log", "Anti-Spam", "spam-mute-warn", "spam-mute-notification", Sentinel.mainConfig.chat.antiSpam.spamPunishCommand, 0xFF8000),
|
|
||||||
BLOCK_URL("Sentinel Anti-URL Log", "Anti-URL","url-warn","url-notification", null,0xFF0000),
|
|
||||||
BLOCK_UNICODE("Sentinel Anti-Unicode Log", "Anti-Unicode","unicode-warn","unicode-notification", null,0xFF0000),
|
|
||||||
SAFE("Sentinel Chat Log", "You Shouldn't See this!", "spam-mute-warn", "spam-mute-notification", Sentinel.mainConfig.chat.antiSpam.spamPunishCommand, 0x00FF00);
|
|
||||||
|
|
||||||
private final String title;
|
|
||||||
private final String name;
|
|
||||||
private final String warnTranslationKey;
|
|
||||||
private final String notifTranslationKey;
|
|
||||||
private final String executedCommand;
|
|
||||||
private final int embedColor;
|
|
||||||
|
|
||||||
FAT(String title, String name, String warnTranslationKey, String notifTranslationKey, String executedCommand, int embedColor) {
|
|
||||||
this.title = title;
|
|
||||||
this.name = name;
|
|
||||||
this.warnTranslationKey = warnTranslationKey;
|
|
||||||
this.notifTranslationKey = notifTranslationKey;
|
|
||||||
this.executedCommand = executedCommand;
|
|
||||||
this.embedColor = embedColor;
|
|
||||||
}
|
|
||||||
public String getTitle() {
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
public String getWarnTranslationKey() {
|
|
||||||
return warnTranslationKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getNotifTranslationKey() {
|
|
||||||
return notifTranslationKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getExecutedCommand() {
|
|
||||||
return executedCommand;
|
|
||||||
}
|
|
||||||
public int getColor() {
|
|
||||||
return embedColor;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@ package io.github.thetrouper.sentinel.data;
|
|||||||
|
|
||||||
import io.github.thetrouper.sentinel.Sentinel;
|
import io.github.thetrouper.sentinel.Sentinel;
|
||||||
|
|
||||||
public record FilterActionType(String logTitle, String logName, String chatWarning, String chatWarningHover, String chatNotification, String chatNotificationHover, String punishmentCommand, int embedColor, boolean isLogged) {
|
public record FilterActionType(String logSuper, String logName, String chatWarning, String chatWarningHover, String chatNotification, String chatNotificationHover, String punishmentCommand, int embedColor, boolean isLogged) {
|
||||||
|
|
||||||
public static final FilterActionType UNICODE_BLOCK = new FilterActionType("Sentinel Anti-Unicode Log", "Anti-Unicode", Sentinel.lang.unicodeFilter.unicodeWarn, Sentinel.lang.automatedActions.actionAutomaticReportable, Sentinel.lang.unicodeFilter.unicodeNotification, Sentinel.lang.unicodeFilter.unicodeNotificationHover, null, 0xAAAAFF, Sentinel.mainConfig.chat.logUnicode);
|
public static final FilterActionType UNICODE_BLOCK = new FilterActionType("Sentinel Anti-Unicode Log", "Anti-Unicode", Sentinel.lang.unicodeFilter.unicodeWarn, Sentinel.lang.automatedActions.actionAutomaticReportable, Sentinel.lang.unicodeFilter.unicodeNotification, Sentinel.lang.unicodeFilter.unicodeNotificationHover, null, 0xAAAAFF, Sentinel.mainConfig.chat.logUnicode);
|
||||||
public static final FilterActionType URL_BLOCK = new FilterActionType("Sentinel Anti-URL Log", "Anti-URL", Sentinel.lang.urlFilter.urlWarn, Sentinel.lang.automatedActions.actionAutomaticReportable, Sentinel.lang.urlFilter.urlNotification, Sentinel.lang.urlFilter.urlNotificationHover, null, 0xAAAAFF, Sentinel.mainConfig.chat.logURL);
|
public static final FilterActionType URL_BLOCK = new FilterActionType("Sentinel Anti-URL Log", "Anti-URL", Sentinel.lang.urlFilter.urlWarn, Sentinel.lang.automatedActions.actionAutomaticReportable, Sentinel.lang.urlFilter.urlNotification, Sentinel.lang.urlFilter.urlNotificationHover, null, 0xAAAAFF, Sentinel.mainConfig.chat.logURL);
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package io.github.thetrouper.sentinel.data;
|
||||||
|
|
||||||
|
public record NewActionType(String superTitle, String title, int embedColor, String chatNotification) {
|
||||||
|
public static final NewActionType CMD_BLOCK_EXECUTE = new NewActionType("Command Block Whitelist Log", "An unauthorized command block has been detected",0xFF0000,"The Command Block Whitelist has been triggered!");
|
||||||
|
public static final NewActionType CMD_BLOCK_PLACE = new NewActionType("Anti-Nuke Log", "A player attempted to place a command block",0xFF0000,"§e%s§7 has triggered the Anti-Nuke!");
|
||||||
|
public static final NewActionType CMD_BLOCK_USE = new NewActionType("Anti-Nuke Log", "A player attempted to use a command block",0xFF0000,"§e%s§7 has triggered the Anti-Nuke!");
|
||||||
|
public static final NewActionType CMD_BLOCK_CHANGE = new NewActionType("Anti-Nuke Log", "A player attempted to change a command block",0xFF0000,"§e%s§7 has triggered the Anti-Nuke!");
|
||||||
|
public static final NewActionType CMD_MINECART_USE = new NewActionType("Anti-Nuke Log", "A player attempted to use a command minecart",0xFF0000,"§e%s§7 has triggered the Anti-Nuke!");
|
||||||
|
public static final NewActionType CMD_MINECART_PLACE = new NewActionType("Anti-Nuke Log", "A player attempted to place a command minecart",0xFF0000,"§e%s§7 has triggered the Anti-Nuke!");
|
||||||
|
public static final NewActionType CMD_MINECART_BREAK = new NewActionType("Anti-Nuke Log", "A player attempted to break a command minecart",0xFF0000,"§e%s§7 has triggered the Anti-Nuke!");
|
||||||
|
public static final NewActionType CMD_EXECUTE = new NewActionType("Anti-Nuke Log", "A player attempted to run a dangerous command",0xFF0000,"§e%s§7 has triggered the Anti-Nuke!");
|
||||||
|
public static final NewActionType CMD_SPECIFIC = new NewActionType("Anti-Specific Log", "A player attempted to run a plugin specific command",0xFF0000,"§e%s§7 has triggered the Anti-Specific.");
|
||||||
|
public static final NewActionType CMD_LOGGED = new NewActionType("Command Log", "A player has ran a logged command",0xFF0000,"§e%s§7 has ran a logged command.");
|
||||||
|
public static final NewActionType NBT_PULL = new NewActionType("Anti-NBT Log", "A player attempted to pull out an NBT item",0xFF0000,"§e%s§7 has triggered the Anti-NBT!");
|
||||||
|
}
|
||||||
@@ -107,7 +107,7 @@ public class FilterAction {
|
|||||||
public static void sendDiscordLog(FilterActionType type, Player offender, String message) {
|
public static void sendDiscordLog(FilterActionType type, Player offender, String message) {
|
||||||
CompletableFuture.runAsync(()->{
|
CompletableFuture.runAsync(()->{
|
||||||
|
|
||||||
String superTitle = type.logTitle();
|
String superTitle = type.logSuper();
|
||||||
String title = "%s has triggered the %s!".formatted(offender.getName(),type.logName());
|
String title = "%s has triggered the %s!".formatted(offender.getName(),type.logName());
|
||||||
boolean isSwear = type.equals(FilterActionType.SWEAR_BLOCK) || type.equals(FilterActionType.SWEAR_PUNISH) || type.equals(FilterActionType.SLUR_PUNISH);
|
boolean isSwear = type.equals(FilterActionType.SWEAR_BLOCK) || type.equals(FilterActionType.SWEAR_PUNISH) || type.equals(FilterActionType.SLUR_PUNISH);
|
||||||
boolean isSpam = type.equals(FilterActionType.SPAM_BLOCK) || type.equals(FilterActionType.SPAM_PUNISH);
|
boolean isSpam = type.equals(FilterActionType.SPAM_BLOCK) || type.equals(FilterActionType.SPAM_PUNISH);
|
||||||
@@ -156,7 +156,7 @@ public class FilterAction {
|
|||||||
public static void sendConsoleLog(FilterActionType type, Player offender, String message) {
|
public static void sendConsoleLog(FilterActionType type, Player offender, String message) {
|
||||||
StringBuilder log = new StringBuilder();
|
StringBuilder log = new StringBuilder();
|
||||||
|
|
||||||
String superTitle = "\n]=- " + type.logTitle() + " -=[";
|
String superTitle = "\n]=- " + type.logSuper() + " -=[";
|
||||||
String title = "\n%s has triggered the %s!\n".formatted(offender.getName(),type.logName());
|
String title = "\n%s has triggered the %s!\n".formatted(offender.getName(),type.logName());
|
||||||
boolean isSwear = type.equals(FilterActionType.SWEAR_BLOCK) || type.equals(FilterActionType.SWEAR_PUNISH) || type.equals(FilterActionType.SLUR_PUNISH);
|
boolean isSwear = type.equals(FilterActionType.SWEAR_BLOCK) || type.equals(FilterActionType.SWEAR_PUNISH) || type.equals(FilterActionType.SLUR_PUNISH);
|
||||||
boolean isSpam = type.equals(FilterActionType.SPAM_BLOCK) || type.equals(FilterActionType.SPAM_PUNISH);
|
boolean isSpam = type.equals(FilterActionType.SPAM_BLOCK) || type.equals(FilterActionType.SPAM_PUNISH);
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package io.github.thetrouper.sentinel.server;
|
package io.github.thetrouper.sentinel.server;
|
||||||
|
|
||||||
|
|
||||||
|
import io.github.itzispyder.pdk.plugin.builders.ItemBuilder;
|
||||||
|
import io.github.itzispyder.pdk.utils.SchedulerUtils;
|
||||||
import io.github.itzispyder.pdk.utils.discord.DiscordEmbed;
|
import io.github.itzispyder.pdk.utils.discord.DiscordEmbed;
|
||||||
import io.github.itzispyder.pdk.utils.discord.DiscordWebhook;
|
import io.github.itzispyder.pdk.utils.discord.DiscordWebhook;
|
||||||
import io.github.thetrouper.sentinel.Sentinel;
|
import io.github.thetrouper.sentinel.Sentinel;
|
||||||
@@ -12,9 +14,13 @@ import io.github.thetrouper.sentinel.server.util.Text;
|
|||||||
import net.md_5.bungee.api.chat.HoverEvent;
|
import net.md_5.bungee.api.chat.HoverEvent;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.attribute.Attribute;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
import org.bukkit.inventory.ItemFlag;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -97,100 +103,7 @@ public class NewAction {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
public NewAction execute() {
|
public NewAction execute() {
|
||||||
String actionTop = action.getMessageTop();
|
|
||||||
String actionTitle = action.getMessageTitle();
|
|
||||||
String itemLog = (item != null && item.hasItemMeta() && item.getItemMeta().getAsString() != null) ? FileUtils.createNBTLog(item) : "";
|
|
||||||
String commandLog = (loggedCommand != null) ? FileUtils.createCommandLog(loggedCommand) : "";
|
|
||||||
|
|
||||||
final List<String> punishCommands = Sentinel.mainConfig.plugin.punishCommands;
|
|
||||||
|
|
||||||
if (denied) {
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (deoped) {
|
|
||||||
player.setOp(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (punished) {
|
|
||||||
for (String command : punishCommands) {
|
|
||||||
ServerUtils.sendCommand(command.replaceAll("%player%",player.getName()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (revertGM) {
|
|
||||||
player.setGameMode(GameMode.SURVIVAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (notifyConsole) {
|
|
||||||
String conNotif = "]=- Sentinel -=[\n";
|
|
||||||
conNotif += actionTop + "\n";
|
|
||||||
conNotif += (player != null) ? "Player: " + player.getName() + "\n" : "";
|
|
||||||
conNotif += (command != null) ? ((loggedCommand != null && loggedCommand.length() > 128) ? "Command: Too long to show here!\n | Saved to file: " + commandLog + "\n" : "Command: " + command + "\n") : "";
|
|
||||||
conNotif += (item != null) ? "Item: /Sentinel/LoggedNBT/" + itemLog + "\n" : "";
|
|
||||||
conNotif += (block != null) ? "Block: " + block.getType().toString().toLowerCase().replace("_", " ") + "\nLocation: " + block.getLocation().getX() + " " + block.getLocation().getY() + " " + block.getLocation().getZ() + "\n" : "";
|
|
||||||
conNotif += "Denied: " + (denied ? "\u2714" : "\u2718") + "\n";
|
|
||||||
conNotif += "Deoped: " + (deoped ? "\u2714" : "\u2718") + "\n";
|
|
||||||
conNotif += "Punished: " + (punished ? "\u2714" : "\u2718") + "\n";
|
|
||||||
conNotif += (revertGM) ? "RevertGM: \u2714\n" : "";
|
|
||||||
conNotif += "Logged: " + (notifyDiscord ? "\u2714" : "\u2718");
|
|
||||||
Sentinel.log.info(conNotif);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (notifyTrusted) {
|
|
||||||
TextComponent notification = new TextComponent();
|
|
||||||
notification.setText(Text.prefix(" " + actionTop));
|
|
||||||
String body = "&b]=- Sentinel -=[&f\n" + actionTitle + "&r\n";
|
|
||||||
body += (player != null) ? "&fPlayer: &b" + player.getName() + "&r\n" : "";
|
|
||||||
body += (command != null) ? ((loggedCommand != null && loggedCommand.length() > 64) ? "&fCommand: &cToo long to show here!&r\n &7&l| &fSaved to file: &b" + commandLog + "&r\n" : "&fCommand: &b" + command + "&r\n") : "";
|
|
||||||
body += (item != null) ? "&fItem: &b/Sentinel/LoggedNBT/&b" + itemLog + "\n" : "";
|
|
||||||
body += (block != null) ? "&fBlock: &b" + block.getType().toString().toLowerCase().replace("_", " ") + "\n&fLocation: &b" + block.getLocation().getX() + " " + block.getLocation().getY() + " " + block.getLocation().getZ() + "&r\n" : "";
|
|
||||||
body += "&fDenied: &b" + (denied ? "&a\u2714" : "&c\u2718") + "&r\n";
|
|
||||||
body += "&fDeoped: " + (deoped ? "&a\u2714" : "&c\u2718") + "&r\n";
|
|
||||||
body += "&fPunished: " + (punished ? "&a\u2714" : "&c\u2718") + "&r\n";
|
|
||||||
body += (revertGM) ? "&fRevertGM: &a\u2714\n" : "";
|
|
||||||
body += "&fLogged: " + (notifyDiscord ? "&a\u2714" : "&c\u2718");
|
|
||||||
notification.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new net.md_5.bungee.api.chat.hover.content.Text(Text.color(body))));
|
|
||||||
ServerUtils.forEachPlayer(trusted -> {
|
|
||||||
if (Sentinel.isTrusted(trusted)) {
|
|
||||||
trusted.spigot().sendMessage(notification);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (notifyDiscord) {
|
|
||||||
String description = (player != null) ? Emojis.rightSort + " **Player:** " + player.getName() + " " + Emojis.member + "\n" : "";
|
|
||||||
description += (command != null) ? ((loggedCommand != null && loggedCommand.length() > 128) ? Emojis.rightSort + " **Command:** Too long to show here! " + Emojis.nuke + "\n | Saved to file: " + commandLog + "\n" : Emojis.rightSort + " **Command:** " + command + " " + Emojis.nuke + "\n") : "";
|
|
||||||
description += (item != null) ? Emojis.rightSort + " **Item:** " + item.getType().toString().toLowerCase() + " " + Emojis.nuke + "\n" + Emojis.space + Emojis.rightDoubleArrow + "**NBT:** Uploaded to /Sentinel/LoggedNBT/" + itemLog : "";
|
|
||||||
description += (block != null) ? Emojis.rightSort + " **Block:** " + block.getType().toString().toLowerCase() + " " + Emojis.nuke + "\n" + Emojis.space + Emojis.rightDoubleArrow + " **Location:** X: " + block.getX() + " Y: " + block.getY() + " Z: " + block.getZ() + "\n" : "";
|
|
||||||
String actions = Emojis.rightSort + " **Denied:** " + (denied ? Emojis.success : Emojis.failure) + "\n";
|
|
||||||
actions += Emojis.rightSort + " **De-oped:** " + (deoped ? Emojis.success : Emojis.failure) + "\n";
|
|
||||||
actions += Emojis.rightSort + " **Punished:** " + (punished ? Emojis.success : Emojis.failure) + "\n";
|
|
||||||
actions += (revertGM) ? Emojis.rightSort + " **GM Reverted:** " + Emojis.success + "\n" : "";
|
|
||||||
actions += Emojis.rightSort + " **Logged:** " + Emojis.success;
|
|
||||||
|
|
||||||
try {
|
|
||||||
String finalDescription = description;
|
|
||||||
String finalActions = actions;
|
|
||||||
CompletableFuture.runAsync(()->{
|
|
||||||
ServerUtils.sendDebugMessage("Executing webhook...");
|
|
||||||
DiscordWebhook.create()
|
|
||||||
.username("Sentinel Anti-Nuke | Logs")
|
|
||||||
.avatar("https://r2.e-z.host/d440b58a-ba90-4839-8df6-8bba298cf817/3lwit5nt.png")
|
|
||||||
.addEmbed(DiscordEmbed.create()
|
|
||||||
.author(new DiscordEmbed.Author(actionTop,"https://builtbybit.com/resources/sentinel-anti-nuke.30130/",null))
|
|
||||||
.title(actionTitle)
|
|
||||||
.desc(finalDescription)
|
|
||||||
.addField(new DiscordEmbed.Field("Actions:", finalActions,false))
|
|
||||||
.thumbnail("https://crafatar.com/avatars/" + (player == null ? "049460f7-21cb-42f5-8059-d42752bf406f" : player.getUniqueId()) + "?size=64&&overlay")
|
|
||||||
.color(action.getEmbedColor())
|
|
||||||
.build()).send(Sentinel.mainConfig.plugin.webhook);
|
|
||||||
});
|
|
||||||
} catch (Exception e) {
|
|
||||||
ServerUtils.sendDebugMessage(Text.prefix("Epic webhook failure!!!"));
|
|
||||||
Sentinel.log.info(e.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new NewAction(event, action, player, command, loggedCommand, item, block, denied, deoped, punished, revertGM, notifyDiscord, notifyTrusted, notifyConsole);
|
return new NewAction(event, action, player, command, loggedCommand, item, block, denied, deoped, punished, revertGM, notifyDiscord, notifyTrusted, notifyConsole);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,14 +51,6 @@ public class ProfanityFilter {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private static FAT getFAT(FilterSeverity severity) {
|
|
||||||
return switch (severity) {
|
|
||||||
case SAFE -> FAT.SAFE;
|
|
||||||
case LOW, MEDIUM_LOW, MEDIUM, MEDIUM_HIGH, HIGH -> FAT.BLOCK_SWEAR;
|
|
||||||
case SLUR -> FAT.SLUR_PUNISH;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String highlightProfanity(String text) {
|
public static String highlightProfanity(String text) {
|
||||||
return highlightProfanity(text, "&e", "&f");
|
return highlightProfanity(text, "&e", "&f");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ permissions:
|
|||||||
sentinel.chat.antiswear.bypass:
|
sentinel.chat.antiswear.bypass:
|
||||||
description: Bypass the antiSwear
|
description: Bypass the antiSwear
|
||||||
default: op
|
default: op
|
||||||
|
sentinel.chat.antiswear.edit:
|
||||||
|
description: Add a false positive to the config
|
||||||
|
default: op
|
||||||
sentinel.chat.antispam.flags:
|
sentinel.chat.antispam.flags:
|
||||||
description: See antispam flags
|
description: See antispam flags
|
||||||
default: op
|
default: op
|
||||||
|
|||||||
Reference in New Issue
Block a user