summaryrefslogtreecommitdiff
path: root/server/src/commands/mod/Prune.ts
diff options
context:
space:
mode:
author8cy <[email protected]>2020-07-24 06:33:39 -0700
committer8cy <[email protected]>2020-07-24 06:33:39 -0700
commit35622cb6d6a7ab969d973aacf8c786707fb322be (patch)
tree5b04d53aaf1798fdb70a48dd4e307a509f10e0c1 /server/src/commands/mod/Prune.ts
parentstage (diff)
downloaddep-core-35622cb6d6a7ab969d973aacf8c786707fb322be.tar.xz
dep-core-35622cb6d6a7ab969d973aacf8c786707fb322be.zip
big stuffs here
Diffstat (limited to 'server/src/commands/mod/Prune.ts')
-rw-r--r--server/src/commands/mod/Prune.ts17
1 files changed, 14 insertions, 3 deletions
diff --git a/server/src/commands/mod/Prune.ts b/server/src/commands/mod/Prune.ts
index bf56846..55307bc 100644
--- a/server/src/commands/mod/Prune.ts
+++ b/server/src/commands/mod/Prune.ts
@@ -31,9 +31,20 @@ export default class PruneMod extends Command {
}
public exec(msg: Message, { amount }): Promise<Message> {
- if (amount <= 100) amount = 99;
+ msg.delete();
+ let limit = false;
+ if (amount >= 100){
+ amount = 99;
+ limit = true;
+ }
(msg.channel as TextChannel).bulkDelete(amount, true);
- return msg.reply('Due to Discord API limitations, the amount of messages you have specified has been rounded down to **99**. (This message will automatically be deleted in 3 seconds.)')
- .then(m => m.delete({ timeout: 3000 }));
+ if (limit) {
+ msg.reply('Due to Discord API limitations, the amount of messages you have specified has been rounded down to **99**. (This message will automatically be deleted in 3 seconds.)')
+ .then(m => m.delete({ timeout: 3000 }));
+ }
+ if (amount > 1)
+ return msg.reply(`**${amount}** messages have been successfully pruned!`);
+ else
+ return msg.reply(`**${amount}** message has been successfully pruned!`);
}
} \ No newline at end of file