mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 09:08:01 +01:00
Fix Discord /list command showing tags in output (#5698)
This commit is contained in:
parent
185b4e266b
commit
d4b72c8af6
@ -40,6 +40,13 @@ public final class FormatUtil {
|
||||
return ChatColor.stripColor(input);
|
||||
}
|
||||
|
||||
public static String stripMiniFormat(final String input) {
|
||||
if (input == null) {
|
||||
return null;
|
||||
}
|
||||
return AdventureUtil.miniMessage().stripTags(input);
|
||||
}
|
||||
|
||||
//This method is used to simply strip the & convention colour codes
|
||||
public static String stripEssentialsFormat(final String input) {
|
||||
if (input == null) {
|
||||
|
@ -3,6 +3,7 @@ package net.essentialsx.discord.interactions.commands;
|
||||
import com.earth2me.essentials.IEssentials;
|
||||
import com.earth2me.essentials.PlayerList;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.FormatUtil;
|
||||
import net.essentialsx.api.v2.services.discord.InteractionCommandArgument;
|
||||
import net.essentialsx.api.v2.services.discord.InteractionCommandArgumentType;
|
||||
import net.essentialsx.api.v2.services.discord.InteractionEvent;
|
||||
@ -45,8 +46,8 @@ public class ListCommand extends InteractionCommandImpl {
|
||||
|
||||
final StringBuilder stringBuilder = new StringBuilder();
|
||||
for (final String str : output) {
|
||||
stringBuilder.append(str).append("\n");
|
||||
stringBuilder.append(FormatUtil.stripMiniFormat(str)).append("\n");
|
||||
}
|
||||
event.reply(MessageUtil.sanitizeDiscordMarkdown(stringBuilder.substring(0, stringBuilder.length() - 2)));
|
||||
event.reply(MessageUtil.sanitizeDiscordMarkdown(stringBuilder.substring(0, stringBuilder.length() - 1)));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user