Fix mc command by converting all info to strings
Some checks are pending
CI / CI (push) Waiting to run
Some checks are pending
CI / CI (push) Waiting to run
This commit is contained in:
parent
3d674f12e0
commit
aa10d6bc27
1 changed files with 7 additions and 12 deletions
|
@ -21,20 +21,15 @@ module.exports = {
|
||||||
if(host === "") return message.channel.send("No host provided")
|
if(host === "") return message.channel.send("No host provided")
|
||||||
let info = await getMinecraftServerInfo(host, port);
|
let info = await getMinecraftServerInfo(host, port);
|
||||||
if (info) {
|
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()
|
const embed = new EmbedBuilder()
|
||||||
embed.setColor("#ee7939")
|
embed.setColor("#ee7939")
|
||||||
embed.setTimestamp()
|
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] });
|
message.channel.send({ embeds: [embed] });
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue