mirror of
https://github.com/Expand-sys/ccashbot
synced 2025-12-16 15:42:13 +11:00
whitelist command and made app as a whole more portable
This commit is contained in:
parent
4c344be737
commit
468b10443f
5 changed files with 42 additions and 23 deletions
|
|
@ -6,9 +6,9 @@ module.exports = {
|
|||
async execute(message, args) {
|
||||
let bal = await checkbal(message.author, args[0]);
|
||||
if (bal == -1) {
|
||||
message.reply("User not found fucko");
|
||||
message.reply("User not found");
|
||||
} else {
|
||||
message.reply(bal.toString() + " piss points");
|
||||
message.reply(bal.toString() + " CCash");
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,29 +6,28 @@ const { spawn } = require("child_process");
|
|||
|
||||
module.exports = {
|
||||
name: "mc",
|
||||
description: "send a mc command",
|
||||
description: "send a Minecraft command",
|
||||
guildOnly: true,
|
||||
permissions: "SEND_MESSAGES",
|
||||
permissions: `${process.env.MCACCESS}`,
|
||||
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",
|
||||
host: `${host}`,
|
||||
port: 25575,
|
||||
password: "6pnyf2DsCfHV67d3",
|
||||
password: `${rconpass}`,
|
||||
});
|
||||
|
||||
await rcon.connect();
|
||||
let content = message.content.substring(message.content.indexOf(" ") + 1);
|
||||
console.log(content);
|
||||
let fuck = content.split("say ");
|
||||
let speech = content.split("say ");
|
||||
if (args[0] == "say") {
|
||||
fuck = content.split("say ");
|
||||
fuck[0] = `say ${message.author.username}: ${fuck[1]} `;
|
||||
speech = content.split("say ");
|
||||
speech[0] = `say ${message.author.username}: ${speech[1]} `;
|
||||
}
|
||||
console.log(fuck);
|
||||
let res = await rcon.send(`${fuck[0]}`);
|
||||
let res = await rcon.send(`${speech[0]}`);
|
||||
|
||||
message.reply(`Sent Command ${content}: ${res}`);
|
||||
rcon.end();
|
||||
|
|
|
|||
30
commands/moderation/whitelist.js
Normal file
30
commands/moderation/whitelist.js
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
const fs = require("fs");
|
||||
const got = require("got");
|
||||
|
||||
const { Rcon } = require("rcon-client");
|
||||
const { spawn } = require("child_process");
|
||||
|
||||
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();
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
module.exports = {
|
||||
name: 'args-info',
|
||||
description: 'Information about the arguments provided.',
|
||||
args: true,
|
||||
execute(message, args) {
|
||||
if (args[0] === 'foo') {
|
||||
return message.channel.send('bar');
|
||||
}
|
||||
|
||||
message.channel.send(`First argument: ${args[0]}`);
|
||||
},
|
||||
};
|
||||
2
index.js
2
index.js
|
|
@ -10,6 +10,8 @@ const dotenv = require("dotenv");
|
|||
|
||||
dotenv.config();
|
||||
const prefix = process.env.PREFIX;
|
||||
const rconpass = process.env.RCONPASS;
|
||||
const host = process.env.HOST;
|
||||
|
||||
const client = new Client({
|
||||
intents: [
|
||||
|
|
|
|||
Loading…
Reference in a new issue