From 43d12f247145ddb135afdbdfe4db9026919ee1ec Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Mon, 28 Oct 2024 16:53:47 +0700 Subject: [PATCH] Escape `.` in Discord to fix the invite leaking --- .../java/me/chayapak1/chomens_bot/plugins/DiscordPlugin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 5d64eb2..2c7b9de 100644 --- a/src/main/java/me/chayapak1/chomens_bot/plugins/DiscordPlugin.java +++ b/src/main/java/me/chayapak1/chomens_bot/plugins/DiscordPlugin.java @@ -389,7 +389,7 @@ public class DiscordPlugin { String message; synchronized (logMessages) { StringBuilder logMessage = logMessages.get(channelId); - message = logMessage.toString(); + message = logMessage.toString().replace(".", "\u200b.\u200b"); // the ZWSP fixes discord.gg showing invite final int maxLength = 2_000 - (""" ```ansi