Skip to content

Commit 4f4f3dc

Browse files
v5 Update 7 part 1 (#17)
Extra extra! Read all about it! Part 1 of ... idk. 💀 * Fixed the aliases on 8ball. * Create and finish purge command. * Update bot.js (Typing is hard, Grammarly can help.) * fix up description of the error. error in the error, ay?
1 parent 7819214 commit 4f4f3dc

3 files changed

Lines changed: 54 additions & 3 deletions

File tree

src/app/cmds/Fun/8ball.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
hidden: false,
88
permissions: ["DEFAULT"],
99
cooldown: 2,
10-
aliases: [""],
10+
aliases: [],
1111
syntax: [" <Question>"],
1212
execute: async(app, message, args) => {
1313
let question = args.slice(0).join(" ");

src/app/cmds/Moderation/purge.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
module.exports = {
2+
name: "purge",
3+
description: "Purge those spicy messages",
4+
guildOnly: true,
5+
authorizedGuilds: [],
6+
hidden: false,
7+
permissions: ["MANAGE_MESSAGES"],
8+
cooldown: 5,
9+
aliases: ["prune"],
10+
syntax: [" <Count>"],
11+
execute: async(app, message, args) => {
12+
let msgcount = args.slice(" ")
13+
14+
if (!isNaN(args[0])) {
15+
try {
16+
message.delete();
17+
await message.channel.messages.fetch({ limit: msgcount }).then(fetchedMsgs => {
18+
const msgsPrune = fetchedMsgs.filter(msg => !msg.pinned);
19+
return message.channel.bulkDelete(msgsPrune).then(prunedMsgs => {
20+
app.functions.msgHandler(message, {
21+
embeds: [{
22+
title: `${app.config.system.emotes.success} Purge Successful!`,
23+
color: app.config.system.embedColors.lime,
24+
description: `Successfully purged ${prunedMsgs.size} spicy messages!`,
25+
footer: { text: app.config.system.footerText + " | This message will blow up in 5 seconds."}
26+
}]
27+
}, 0, false, (msg => { setTimeout(() => msg.delete(), 5000) }));
28+
});
29+
});
30+
} catch (e) {
31+
app.functions.msgHandler(message, {
32+
embeds: [{
33+
title: `${app.config.system.emotes.error} Uh-Oh! Something went wrong!`,
34+
color: app.config.system.embedColors.red,
35+
description: `Could not purge messages due to: **${e.message}**`,
36+
footer: { text: app.config.system.footerText + " | An error occurred."}
37+
}]
38+
});
39+
}
40+
} else {
41+
app.functions.msgHandler(message, {
42+
embeds: [{
43+
title: `${app.config.system.emotes.error} Purge Error`,
44+
color: app.config.system.embedColors.red,
45+
description: "You need to specify how many messages to delete!",
46+
footer: { text: app.config.system.footerText + " | An error occurred." }
47+
}]
48+
}, 0, true);
49+
}
50+
}
51+
}

src/bot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
6/24/2021
44
55
Now open-source!
6-
Can you believe it Matt 4 years (as of 2022)
6+
Can you believe it took Matt 4 years (as of 2022)
77
to open-source his bot projects?
8-
Yeah, I know crazy. wait.. why am i talking third-person again?
8+
Yeah, I know crazy. wait.. why am I talking third-person again?
99
1010
https://tcb.nekos.tech/source
1111
https://themattchannel.com

0 commit comments

Comments
 (0)