changed most discord actions to be handled by 1 script. this should cut down on errors and allow you to actually use the bot in other servers (i think)

This commit is contained in:
ayeuhugyu 2023-09-30 08:17:43 -07:00
parent c97762e84c
commit b7492c8ad0
30 changed files with 262 additions and 684 deletions

View file

@ -1,4 +1,5 @@
import fs from "fs";
import * as action from "../util/discordAction.js";
const prefix = process.env.PREFIX;
function delay(time) {
@ -20,11 +21,14 @@ export default {
const msgnoprefix = message.content.slice(
prefix.length + this.name.length + 1
);
const msg = msgnoprefix.slice(0, 2000);
const user = msgnoprefix.slice(0, 2000);
if (msg !== "") {
fs.appendFileSync("../pepperbot/data/guildmembers.log", msg + "\n");
message.reply(`operation completed (🤖); added ${msg} to members file`);
if (user !== "") {
fs.appendFileSync("../pepperbot/data/guildmembers.log", user + "\n");
action.reply(
message,
`operation completed (🤖); added ${user} to members file`
);
}
}
},