mirror of
https://github.com/Expand-sys/ccashbot
synced 2025-12-16 15:42:13 +11:00
fixed fixes
This commit is contained in:
parent
6d72f2ab13
commit
039c2ca0e6
6 changed files with 21 additions and 1433 deletions
|
|
@ -1,39 +0,0 @@
|
||||||
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.length > 1) {
|
|
||||||
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();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
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: "mc",
|
|
||||||
description: "send a Minecraft command",
|
|
||||||
guildOnly: true,
|
|
||||||
permissions: `${process.env.MCACCESS}`,
|
|
||||||
async execute(message, args) {
|
|
||||||
if (!args) {
|
|
||||||
return message.reply("OI you need to specify the command you want");
|
|
||||||
} 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 content = message.content.substring(message.content.indexOf(" ") + 1);
|
|
||||||
console.log(content);
|
|
||||||
let speech = content.split("say ");
|
|
||||||
if (args[0] == "say") {
|
|
||||||
speech = content.split("say ");
|
|
||||||
speech[0] = `say ${message.author.username}: ${speech[1]} `;
|
|
||||||
}
|
|
||||||
if (connected == true){
|
|
||||||
let res = await rcon.send(`${speech[0]}`);
|
|
||||||
message.reply(`Sent Command ${content}: ${res}`);
|
|
||||||
rcon.end();
|
|
||||||
} else {
|
|
||||||
message.reply(`${error}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
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: "whitelist",
|
|
||||||
description: "Whitelist yourself",
|
|
||||||
guildOnly: true,
|
|
||||||
permissions: "SEND_MESSAGES",
|
|
||||||
async execute(message, args) {
|
|
||||||
if (!args) {
|
|
||||||
return message.reply("OI you need to specify your username you want to whitelist");
|
|
||||||
} 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 content = message.content.split("!whitelist ")[1];
|
|
||||||
console.log(content);
|
|
||||||
let res = await rcon.send(`whitelist add ${content}`);
|
|
||||||
|
|
||||||
message.reply(`${res}`);
|
|
||||||
rcon.end();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
39
index.js
39
index.js
|
|
@ -51,27 +51,30 @@ client.once("ready", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on("message", async (message) => {
|
client.on("message", async (message) => {
|
||||||
if (message.channel == process.env.CHATCHANNEL || message.mentions.members.first().user.id == 216882708012466176) {
|
if (message.mentions.members.first()){
|
||||||
let question = message.content.split(" ")
|
if (message.mentions.members.first().user.id == 216882708012466176) {
|
||||||
question.shift()
|
let question = message.content.split(" ")
|
||||||
question = question.join(" ")
|
question.shift()
|
||||||
|
question = question.join(" ")
|
||||||
response = await openai.createCompletion({
|
|
||||||
model: "text-davinci-003",
|
response = await openai.createCompletion({
|
||||||
|
model: "text-davinci-003",
|
||||||
|
|
||||||
|
prompt: `${question}`,
|
||||||
|
temperature: 0.5,
|
||||||
|
max_tokens: 500,
|
||||||
|
top_p: 0.3,
|
||||||
|
frequency_penalty: 0.5,
|
||||||
|
presence_penalty: 0.0
|
||||||
|
}
|
||||||
|
)
|
||||||
|
console.log(response.data)
|
||||||
|
message.reply(response.data.choices[0].text)
|
||||||
|
|
||||||
|
|
||||||
prompt: `${question}`,
|
|
||||||
temperature: 0.5,
|
|
||||||
max_tokens: 60,
|
|
||||||
top_p: 0.3,
|
|
||||||
frequency_penalty: 0.5,
|
|
||||||
presence_penalty: 0.0
|
|
||||||
}
|
}
|
||||||
)
|
|
||||||
console.log(response)
|
|
||||||
message.reply(response.data.choices[0].text)
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!message.content.startsWith(prefix) || message.author.bot) return;
|
if (!message.content.startsWith(prefix) || message.author.bot) return;
|
||||||
|
|
||||||
|
|
|
||||||
1276
package-lock.json
generated
1276
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -18,14 +18,10 @@
|
||||||
"dotenv": "^10.0.0",
|
"dotenv": "^10.0.0",
|
||||||
"file-type": "^16.5.0",
|
"file-type": "^16.5.0",
|
||||||
"fs": "^0.0.1-security",
|
"fs": "^0.0.1-security",
|
||||||
"get-pixels": "^3.3.2",
|
|
||||||
"got": "^11.8.2",
|
"got": "^11.8.2",
|
||||||
"minecraft-server-util": "^3.5.2",
|
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"openai": "^3.1.0",
|
"openai": "^3.1.0",
|
||||||
"quick.db": "^7.1.3",
|
|
||||||
"rcon-client": "^4.2.3",
|
|
||||||
"request-promise-cache": "^2.0.1",
|
"request-promise-cache": "^2.0.1",
|
||||||
"superagent": "^6.1.0",
|
"superagent": "^6.1.0",
|
||||||
"unirest": "^0.6.0"
|
"unirest": "^0.6.0"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue