feat?: replace ANSI codes and ZWSP for discord message with nothing so we can read the bot's log message easily from in game

This commit is contained in:
ChomeNS
2025-01-18 16:43:14 +07:00
parent 4478d0287d
commit 90fe3d1145
2 changed files with 5 additions and 1 deletions

View File

@@ -347,6 +347,10 @@ public class DiscordPlugin {
message.getContentDisplay()
// replaces skull emoji
.replace("\uD83D\uDC80", "")
// replaces all ANSI codes (used when a user reply to the bot's log message) with nothing
.replaceAll("\u001B\\[[;\\d]*[ -/]*[@-~]", "")
// replaces all ZWSP with nothing
.replace("\u200b", "")
);
final Component messageComponent = Component