From aa10d6bc271d06d3ad2197b36330c4a53092d5f5 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Sun, 27 Jul 2025 14:55:15 +0200 Subject: [PATCH] Fix mc command by converting all info to strings --- commands/info/mc.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/commands/info/mc.js b/commands/info/mc.js index c60d302..b0cd66b 100644 --- a/commands/info/mc.js +++ b/commands/info/mc.js @@ -21,20 +21,15 @@ module.exports = { if(host === "") return message.channel.send("No host provided") let info = await getMinecraftServerInfo(host, port); if (info) { - let descriptionArr = [ - `Ping: ${info.ping.toString()}`, - `Player Count: ${info.playercount}`, - `Max Players: ${info.maxPlayers}`, - `MOTD: ${info.motd}` - ] - let description = ""; - descriptionArr.forEach(desc => { - description += `${desc}\n`; - }) const embed = new EmbedBuilder() embed.setColor("#ee7939") embed.setTimestamp() - embed.setDescription(description) + embed.addFields( + { name: "ping", value: info.ping.toString(), inline: false }, + { name: "Player Count", value: info.playercount.toString(), inline: false }, + { name: "Max Players", value: info.maxPlayers.toString(), inline: false }, + { name: "MOTD", value: info.motd, inline: false }, + ) message.channel.send({ embeds: [embed] }); } else { @@ -105,4 +100,4 @@ async function getMinecraftServerInfo(host, port = 25565) { }) }) return serverInfo -} \ No newline at end of file +}