parent
0a8df28a94
commit
3d674f12e0
1 changed files with 13 additions and 9 deletions
|
@ -6,7 +6,7 @@ const { EmbedBuilder } = require('discord.js');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'mc', // Keep it to one word
|
name: 'mc', // Keep it to one word
|
||||||
description: 'get mc server info from lazy duchess server',
|
description: 'get minecraft server information',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
whitelist: true,
|
whitelist: true,
|
||||||
async execute({ message, args }) {
|
async execute({ message, args }) {
|
||||||
|
@ -21,16 +21,20 @@ 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) {
|
||||||
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()
|
const embed = new EmbedBuilder()
|
||||||
embed.setColor("#ee7939")
|
embed.setColor("#ee7939")
|
||||||
embed.setTimestamp()
|
embed.setTimestamp()
|
||||||
embed.addFields([
|
embed.setDescription(description)
|
||||||
{ 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 },
|
|
||||||
])
|
|
||||||
|
|
||||||
message.channel.send({ embeds: [embed] });
|
message.channel.send({ embeds: [embed] });
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue