refactor: replace ONLY discord.gg with discord{zwsp}.{zwsp}gg instead of every single . with {zwsp}.{zwsp}

the reason i have to do this is because people keep copying players ips from `/seen` logs (which contain zwsp) and put them into ipfilter, and since they contain zwsp, they'll never work, gonna consider adding IP regex check
This commit is contained in:
ChomeNS
2025-04-07 07:59:33 +07:00
parent 1c7cd3038c
commit c0390b806f
2 changed files with 6 additions and 2 deletions

View File

@@ -1 +1 @@
2396
2397

View File

@@ -531,12 +531,16 @@ public class DiscordPlugin extends ListenerAdapter {
String message;
synchronized (logMessages) {
StringBuilder logMessage = logMessages.get(channelId);
message = logMessage.toString().replace(".", "\u200b.\u200b"); // the ZWSP fixes discord.gg showing invite
message = logMessage.toString()
// the ZWSP fixes discord.gg showing invite
.replace("discord.gg", "discord\u200b.\u200bgg");
final int maxLength = 2_000 - ("""
```ansi
```"""
).length(); // kinda sus
if (message.length() >= maxLength) {
message = message.substring(0, maxLength);
}