aboutsummaryrefslogtreecommitdiff
path: root/commands/purge.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2020-05-22 20:36:26 -0400
committerAndrew Lee <alee14498@protonmail.com>2020-05-22 20:36:26 -0400
commitfc76d7c73ae9ffec6be86fc7d9d9e8c9a14605ab (patch)
tree0f4930fd8655e550c974bc404b93149cf7eab4ac /commands/purge.js
parentbbb982243b6564e526fb581f55946704cdf256a3 (diff)
downloadAleeBot-fc76d7c73ae9ffec6be86fc7d9d9e8c9a14605ab.tar.gz
AleeBot-fc76d7c73ae9ffec6be86fc7d9d9e8c9a14605ab.tar.bz2
AleeBot-fc76d7c73ae9ffec6be86fc7d9d9e8c9a14605ab.zip
Added more ALP exclusive logs & cleaning up code
Diffstat (limited to 'commands/purge.js')
-rw-r--r--commands/purge.js41
1 files changed, 20 insertions, 21 deletions
diff --git a/commands/purge.js b/commands/purge.js
index 9a510f9..6122083 100644
--- a/commands/purge.js
+++ b/commands/purge.js
@@ -1,5 +1,5 @@
-/****************************************
- *
+/** **************************************
+ *
* Purge: Command for AleeBot
* Copyright (C) 2017-2020 Alee Productions
*
@@ -15,26 +15,25 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ *
* *************************************/
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 (!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.');
- 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.`));
+};
- 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
+exports.conf = {
+ aliases: ['rm'],
+ guildOnly: false,
+};
+exports.help = {
+ name: 'purge',
+ description: 'Removes messages in a bulk.',
+ usage: 'purge [number]',
+ category: '- Moderation Commands',
+};