added p/vileimagery

This commit is contained in:
ayeuhugyu 2023-09-09 17:14:13 -07:00
parent a2f620d5ee
commit 1ea7fe9f03
4 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,31 @@
const fs = require("fs");
const prefix = process.env.PREFIX;
function delay(time) {
return new Promise((resolve) => {
setTimeout(resolve, time);
});
}
const whitelist = ["440163494529073152", "611625001950380032"];
module.exports = {
name: "addguildmember",
description:
"manually adds a guild member to the members list, whitelist required",
execute(message, args) {
if (whitelist.includes(message.author.id)) {
if (message.author.bot) return;
const msgnoprefix = message.content.slice(
prefix.length + this.name.length + 1
);
const msg = msgnoprefix.slice(0, 2000);
if (msg !== "") {
fs.appendFileSync("../pepperbot/src/data/guildmembers.log", msg + "\n");
message.reply(`operation completed (🤖); added ${msg} to members file`);
}
}
},
};

View file

@ -0,0 +1,16 @@
module.exports = {
name: "guildmembers",
description:
"sends a file including all past guild members (may not be accurrate, is mostly manually updated)",
execute(message, args) {
const path = `../pepperbot/src/data/guildmembers.log`;
message.channel.send({
files: [
{
attachment: path,
name: "guildmembers.log",
},
],
});
},
};

View file

@ -36,6 +36,18 @@ client.on("ready", (c) => {
const channel = client.channels.cache.get("1148814162273763418");
channel.send("pepperbot restart complete");
});
client.on("guildMemberAdd", (member) => {
if (member.guild.id === "1112819622505365556") {
fs.appendFileSync(
"../pepperbot/src/data/guildmembers.log",
member.user.username + ` -- added by bot: ${Date()} \n`
);
const channel = client.channels.cache.get("1148814162273763418");
channel.send(
`added new guild member ${member.user.username} (${member.user.id}) to members list`
);
}
});
client.on("messageDelete", async (message) => {
if (message.content.startsWith(prefix)) {