mirror of
https://github.com/Expand-sys/ccashbot
synced 2025-12-16 23:52:14 +11:00
37 lines
985 B
JavaScript
37 lines
985 B
JavaScript
const fs = require("fs");
|
|
const got = require("got");
|
|
|
|
const { Rcon } = require("rcon-client");
|
|
const { spawn } = require("child_process");
|
|
|
|
module.exports = {
|
|
name: "mc",
|
|
description: "send a mc command",
|
|
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: "mc.expand.gay",
|
|
port: 25575,
|
|
password: "6pnyf2DsCfHV67d3",
|
|
});
|
|
|
|
await rcon.connect();
|
|
let content = message.content.substring(message.content.indexOf(" ") + 1);
|
|
console.log(content);
|
|
let fuck;
|
|
if (args[0] == "say") {
|
|
fuck = content.split("say ");
|
|
fuck[1] = `say ${message.author.username}: ${fuck[1]} `;
|
|
}
|
|
console.log(fuck);
|
|
let res = await rcon.send(`${fuck[1]}`);
|
|
|
|
message.reply(`Sent Command ${content}: ${res}`);
|
|
rcon.end();
|
|
}
|
|
},
|
|
};
|