aboutsummaryrefslogtreecommitdiff
path: root/src/commands/purge.js
diff options
context:
space:
mode:
authorAlee <alee14498@gmail.com>2018-03-24 22:56:20 -0400
committerAlee <alee14498@gmail.com>2018-03-24 22:56:20 -0400
commit1c3084c2eed942a9efeb779694cdd77a72f90c47 (patch)
treec1b50561248e4faa2c972ea4d6824c48337114d1 /src/commands/purge.js
parentb33609a43dcad72b2d7b6dc64190037198cd7e53 (diff)
downloadAleeBot-1c3084c2eed942a9efeb779694cdd77a72f90c47.tar.gz
AleeBot-1c3084c2eed942a9efeb779694cdd77a72f90c47.tar.bz2
AleeBot-1c3084c2eed942a9efeb779694cdd77a72f90c47.zip
Added purge and say + 2.3 release
Diffstat (limited to 'src/commands/purge.js')
-rw-r--r--src/commands/purge.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/commands/purge.js b/src/commands/purge.js
new file mode 100644
index 0000000..36a0803
--- /dev/null
+++ b/src/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