From 98f99a4a743e678836440fc27b0585c3cd2c2e27 Mon Sep 17 00:00:00 2001 From: Expand-sys Date: Tue, 3 Jan 2023 13:58:38 +1100 Subject: [PATCH] added list to commands that can be used by others --- commands/moderation/list.js | 39 +++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 commands/moderation/list.js diff --git a/commands/moderation/list.js b/commands/moderation/list.js new file mode 100644 index 0000000..44b096a --- /dev/null +++ b/commands/moderation/list.js @@ -0,0 +1,39 @@ +const fs = require("fs"); +const got = require("got"); + +const { Rcon } = require("rcon-client"); +const { spawn } = require("child_process"); +const rconpass = process.env.RCONPASS; +const host = process.env.MCHOST; + +module.exports = { + name: "list", + description: "check whos online", + guildOnly: true, + permissions: "SEND_MESSAGES", + async execute(message, args) { + if (args) { + return message.reply("fuck bro your confusing me with all them words"); + } else { + console.log(host); + const rcon = new Rcon({ + host: `${host}`, + port: `${process.env.RCON_PORT}`, + password: `${rconpass}`, + }); + let connected = true + let error + try{ + await rcon.connect(); + } catch(e){ + console.log(e) + connected = false + error = e + } + let res = await rcon.send(`list`); + + message.reply(`${res}`); + rcon.end(); + } + }, +};