From c1f0d81fcc54532d5c36f71c7881c7381647a844 Mon Sep 17 00:00:00 2001 From: speedxx <43330808+speedxx@users.noreply.github.com> Date: Thu, 16 Jul 2020 22:24:59 -0400 Subject: [PATCH] remove this blocked string & don't send messages containing discord.gg to server-chat --- .../java/me/totalfreedom/totalfreedommod/ChatManager.java | 8 +------- .../me/totalfreedom/totalfreedommod/discord/Discord.java | 8 +++++++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java b/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java index 8829ab8b..1fe5ec19 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/ChatManager.java @@ -73,12 +73,6 @@ public class ChatManager extends FreedomService return; } - if (message.startsWith("Connected using PickaxeChat for ")) - { - event.setCancelled(true); - return; - } - // Truncate messages that are too long - 256 characters is vanilla client max if (message.length() > 256) { @@ -230,4 +224,4 @@ public class ChatManager extends FreedomService } } } -} +} \ No newline at end of file diff --git a/src/main/java/me/totalfreedom/totalfreedommod/discord/Discord.java b/src/main/java/me/totalfreedom/totalfreedommod/discord/Discord.java index f579382a..60ea9537 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/discord/Discord.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/discord/Discord.java @@ -292,6 +292,12 @@ public class Discord extends FreedomService { message = StringUtils.remove(message, "@"); } + + if (message.toLowerCase().contains("discord.gg")) + { + return; + } + if (enabled && !chat_channel_id.isEmpty()) { CompletableFuture sentMessage = bot.getTextChannelById(chat_channel_id).sendMessage(message).submit(true); @@ -482,4 +488,4 @@ public class Discord extends FreedomService return false; } -} +} \ No newline at end of file