mirror of
https://github.com/Expand-sys/ccashbot
synced 2025-12-16 23:52:14 +11:00
added list to commands that can be used by others
This commit is contained in:
parent
de9f8eaa48
commit
98f99a4a74
1 changed files with 39 additions and 0 deletions
39
commands/moderation/list.js
Normal file
39
commands/moderation/list.js
Normal file
|
|
@ -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();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
Loading…
Reference in a new issue