From 3d674f12e0a7e18d371589edebf59f48be507a3b Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Sun, 27 Jul 2025 14:45:23 +0200 Subject: [PATCH] Fix mc command --- commands/info/mc.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/commands/info/mc.js b/commands/info/mc.js index 1b28b54..c60d302 100644 --- a/commands/info/mc.js +++ b/commands/info/mc.js @@ -6,7 +6,7 @@ const { EmbedBuilder } = require('discord.js'); module.exports = { name: 'mc', // Keep it to one word - description: 'get mc server info from lazy duchess server', + description: 'get minecraft server information', hidden: true, whitelist: true, async execute({ message, args }) { @@ -21,16 +21,20 @@ module.exports = { if(host === "") return message.channel.send("No host provided") let info = await getMinecraftServerInfo(host, port); if (info) { - console.log(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.addFields([ - { name: "ping", value: info.ping.toString(), inline: false }, - { name: "Player Count", value: info.playercount, inline: false }, - { name: "Max Players", value: info.maxPlayers, inline: false }, - { name: "MOTD", value: info.motd, inline: false }, - ]) + embed.setDescription(description) message.channel.send({ embeds: [embed] }); } else { @@ -101,4 +105,4 @@ async function getMinecraftServerInfo(host, port = 25565) { }) }) return serverInfo -} +} \ No newline at end of file