ccashbot/commands/moderation/whitelist.js
Expand-sys 73567576f4 fix
2021-10-19 09:32:50 +11:00

32 lines
817 B
JavaScript

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.HOST;
module.exports = {
name: "whitelist",
description: "Whitelist yourself",
guildOnly: true,
permissions: "SEND_MESSAGES",
async execute(message, args) {
if (!args) {
return message.reply("OI you need to specify the command you want");
} else {
const rcon = new Rcon({
host: `${host}`,
port: 25575,
password: `${rconpass}`,
});
await rcon.connect();
let content = message.content.split("!whitelist ")[1];
let res = await rcon.send(`whitelist add ${content}`);
message.reply(`whitelisted `);
rcon.end();
}
},
};