From 90fe3d11457ec3ac525399fba9f1bdcc85879fde Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 18 Jan 2025 16:43:14 +0700 Subject: [PATCH] feat?: replace ANSI codes and ZWSP for discord message with nothing so we can read the bot's log message easily from in game --- build-number.txt | 2 +- .../java/me/chayapak1/chomens_bot/plugins/DiscordPlugin.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/build-number.txt b/build-number.txt index c4176e46..222272ad 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -1485 \ No newline at end of file +1488 \ No newline at end of file diff --git a/src/main/java/me/chayapak1/chomens_bot/plugins/DiscordPlugin.java b/src/main/java/me/chayapak1/chomens_bot/plugins/DiscordPlugin.java index bb13a694..7b667b28 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/DiscordPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/DiscordPlugin.java @@ -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