added minecraft server command (tracks server status)

This commit is contained in:
yhqe committed 2026-06-07 16:58:43 -05:00
1 parent 554ab445e5
commit 6d2a1a484f
3 files changed
+944 -878

No files matched your search

+877 -877
View File
File diff suppressed because it is too large. Load diff
-1
View File
@@ -2,7 +2,6 @@
const { time } = require("discord.js"); const { time } = require("discord.js");
module.exports = { module.exports = {
name: 'timeout', name: 'timeout',
description: `timeout a user`, description: `timeout a user`,
+67
View File
@@ -0,0 +1,67 @@
'use strict';
const { time } = require("discord.js");
const { exec } = require('child_process');
module.exports = {
name: 'mcserver',
description: `shhhhh`,
aliases: [''],
usage: 'mcserver',
async execute(client, message) {
const sent = await message.reply({
content: null, embeds: [{
color: 0x8aa2b3,
title: '',
author: {
name: message.author.username,
icon_url: message.author.displayAvatarURL(),
},
description: '<a:loading_icon:1366587619890302998> pinging...',
footer: {
text: `twitter @ ${message.guild.name}`,
icon_url: client.user.displayAvatarURL(),
},
timestamp: new Date(),
}]
});
const online = await new Promise((resolve) => {
exec(`ping -n 1 mc.radium.wtf`, (error) => {
resolve(!error);
});
});
let embed;
if (online) {
embed = {
color: 0x8aa2b3,
title: '',
author: {
name: message.author.username,
icon_url: message.author.displayAvatarURL(),
},
description: 'server is online!',
fields: [
{ name: 'ip', value: `mc.radium.wtf`, inline: true },
{ name: 'version', value: `26.1.2 (latest)`, inline: true },
],
footer: {
text: `twitter @ ${message.guild.name}`,
icon_url: client.user.displayAvatarURL(),
},
timestamp: new Date(),
thumbnail: {
url: "https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fcdn.freebiesupply.com%2Flogos%2Flarge%2F2x%2Fminecraft-1-logo-png-transparent.png&f=1&nofb=1&ipt=9aebb419eba433a6b68129b3cb0aeebee3d1f40d3c7ea181b1da41fead97acdd",
height: 2637,
width: 2400,
},
};
}
await sent.edit({ content: null, embeds: [embed] });
},
};