Fix reactions showing up in Discord bridge & colour codes showing up in bridge

This commit is contained in:
Allink
2023-07-25 00:28:58 +01:00
parent 6e140ace7d
commit 08115470b0
4 changed files with 59 additions and 34 deletions

View File

@ -46,8 +46,13 @@ public class ChatManager extends FreedomService
private void handleChatEvent(AsyncPlayerChatEvent event)
{
final Player player = event.getPlayer();
String message = event.getMessage().trim();
String originalMessage = event.getMessage();
if (plugin.mu.onPlayerChat(player) || plugin.sh.handlePlayerChat(player, originalMessage))
{
event.setCancelled(true);
return;
}
String message = originalMessage.trim();
// Format colors and strip &k
message = FUtil.colorize(message);
message = message.replaceAll(ChatColor.MAGIC.toString(), "&k");
@ -82,6 +87,8 @@ public class ChatManager extends FreedomService
return;
}
plugin.dc.onPlayerChat(player, ChatColor.stripColor(message));
// Check for 4chan trigger
if (ConfigEntry.FOURCHAN_ENABLED.getBoolean())
{