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:
@@ -1 +1 @@
|
||||
2396
|
||||
2397
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user