Sanitize all messages being sent to the Discord user to remove colour codes, and add new lines

This commit is contained in:
business-goose 2022-03-23 21:02:05 +00:00
parent 4bc164c09a
commit 37caf04c1d

View file

@ -1,5 +1,6 @@
package me.StevenLawson.TotalFreedomMod.discord.sender; package me.StevenLawson.TotalFreedomMod.discord.sender;
import me.StevenLawson.TotalFreedomMod.discord.bridge.DiscordBridge;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -23,12 +24,12 @@ public class DiscordCommandSender implements CommandSender {
@Override @Override
public void sendMessage(String s) { public void sendMessage(String s) {
user.sendMessage(s); user.sendMessage(DiscordBridge.sanitizeMessage(s));
} }
@Override @Override
public void sendMessage(String[] strings) { public void sendMessage(String[] strings) {
user.sendMessage(String.join("", strings)); user.sendMessage(DiscordBridge.sanitizeMessage(String.join("\n", strings)));
} }
@Override @Override