Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Commit

Permalink
Escape messages of colors before sending them to Minecraft
Browse files Browse the repository at this point in the history
  • Loading branch information
132ikl committed May 28, 2020
1 parent a87cb6f commit 5544a47
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public boolean processCommand(Message message) {

public void processMessage(Message message) {
String author = message.getAuthorAsMember().block().getDisplayName() + ":";
ChatMessage discordMessage = new ChatMessage(author, formatMessage(message), "empty");
ChatMessage discordMessage = new ChatMessage(author.replaceAll("§.", ""), formatMessage(message).replaceAll("§.", ""), "empty");
System.out.println(String.format("[Discord] %s %s", author, discordMessage.getMessage()));
Main.chatServer.sendMessage(discordMessage);
}
Expand Down

0 comments on commit 5544a47

Please sign in to comment.