by popular request (i kept forgetting) the latest version of pepperbot has been published. inclides new blacklist feature (for my own amusement,) random sound, and tons of bug fixes

This commit is contained in:
ayeuhugyu 2023-11-07 19:56:13 -08:00
parent 8c595a9a01
commit 11a76b04ca
6 changed files with 67 additions and 50 deletions

View file

@ -30,13 +30,16 @@ function parseargs(string) {
const prefix = process.env.PREFIX;
export default function (message, client) {
const blacklistnosplit = fs.readFileSync("data/blacklisted.log", "utf8");
const blacklist = blacklistnosplit.split("\n");
if (message.channel.type === 1) {
log(
"directmessages.log",
message,
import.meta.url,
`direct message from ${message.author.username} (${message.author}) with:
"${message.content}"`
\`"${message.content}"\``
);
const channel = client.channels.cache.get("1148814162273763418");
channel.send(
@ -44,6 +47,10 @@ export default function (message, client) {
);
}
if (!message.content.startsWith(prefix)) return;
if (blacklist.includes(message.author.id)) {
message.reply("blacklisted smh");
return;
}
const command = message.content
.slice(prefix.length)
@ -54,24 +61,16 @@ export default function (message, client) {
if (!commands.has(command)) {
message.reply("idiot thats not a command");
log(
"failed.log",
message,
import.meta.url,
`attempt to use invalid command: ${command} by: ${message.author.username} (${message.author})"`
);
}
if (commands.get(command)) {
log(
"commands.log",
message,
import.meta.url,
`use of command: ${command} by: ${message.author.username} (\`${message.author}\`)"`,
true
);
(async () => {
commands.get(command).execute(message, args, client);
})();
return;
}
log(
"commands.log",
message,
import.meta.url,
`use of command: ${command} by: ${message.author.username} (\`${message.author}\`)"`,
true
);
(async () => {
commands.get(command).execute(message, args, client);
})();
}