mirror of
https://github.com/TotalFreedomMC/TotalFreedomMod.git
synced 2024-06-30 09:49:00 +00:00
Merge pull request #230 from speedxx/development
remove this blocked string & don't send messages containing discord.gg to server-chat
This commit is contained in:
commit
d33f661d55
|
@ -73,12 +73,6 @@ public class ChatManager extends FreedomService
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.startsWith("Connected using PickaxeChat for "))
|
|
||||||
{
|
|
||||||
event.setCancelled(true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Truncate messages that are too long - 256 characters is vanilla client max
|
// Truncate messages that are too long - 256 characters is vanilla client max
|
||||||
if (message.length() > 256)
|
if (message.length() > 256)
|
||||||
{
|
{
|
||||||
|
@ -230,4 +224,4 @@ public class ChatManager extends FreedomService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -292,6 +292,12 @@ public class Discord extends FreedomService
|
||||||
{
|
{
|
||||||
message = StringUtils.remove(message, "@");
|
message = StringUtils.remove(message, "@");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (message.toLowerCase().contains("discord.gg"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (enabled && !chat_channel_id.isEmpty())
|
if (enabled && !chat_channel_id.isEmpty())
|
||||||
{
|
{
|
||||||
CompletableFuture<Message> sentMessage = bot.getTextChannelById(chat_channel_id).sendMessage(message).submit(true);
|
CompletableFuture<Message> sentMessage = bot.getTextChannelById(chat_channel_id).sendMessage(message).submit(true);
|
||||||
|
@ -482,4 +488,4 @@ public class Discord extends FreedomService
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue