aboutsummaryrefslogtreecommitdiff
path: root/commands/purge.js
diff options
context:
space:
mode:
authorAlee <alee14498@gmail.com>2018-03-25 09:36:32 -0400
committerAlee <alee14498@gmail.com>2018-03-25 09:36:32 -0400
commit9f39777642b3f44386df711afeab6490dc508007 (patch)
tree90789522e4920934ff0012129525c18c6768953b /commands/purge.js
parent07fe0f9f68d078881c44ddeaadbf09212f089727 (diff)
downloadAleeBot-9f39777642b3f44386df711afeab6490dc508007.tar.gz
AleeBot-9f39777642b3f44386df711afeab6490dc508007.tar.bz2
AleeBot-9f39777642b3f44386df711afeab6490dc508007.zip
Moved all source files
Diffstat (limited to 'commands/purge.js')
-rw-r--r--commands/purge.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/commands/purge.js b/commands/purge.js
new file mode 100644
index 0000000..36a0803
--- /dev/null
+++ b/commands/purge.js
@@ -0,0 +1,21 @@
+module.exports.run = async (client, message, args) => {
+ if (!message.member.permissions.has('MANAGE_MESSAGES')) return message.reply("It looks like that you don't have the permissions to delete messages.")
+ if (isNaN(args[0])) return message.reply("Please put the valid number of messages to purge.");
+
+ if (args[0] > 100) return message.channel.send("Please put a number less than 100.");
+
+ message.channel.bulkDelete(args[0])
+ .then( messages => message.channel.send(`Successfully deleted ${messages.size} messages.`))
+ };
+
+ exports.conf = {
+ aliases: ['rm'],
+ guildOnly: false,
+ };
+ exports.help = {
+ name: 'purge',
+ description: 'Removes messages in a bulk.',
+ usage: 'purge [number]',
+ category: '- Moderation Commands',
+ };
+ \ No newline at end of file