aboutsummaryrefslogtreecommitdiff
path: root/commands/purge.js
diff options
context:
space:
mode:
Diffstat (limited to 'commands/purge.js')
-rw-r--r--commands/purge.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/commands/purge.js b/commands/purge.js
index cf39826..5ce24f8 100644
--- a/commands/purge.js
+++ b/commands/purge.js
@@ -1,4 +1,6 @@
exports.run = async (bot, msg, args) => {
+ if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permssion to manage messages');
+ if (!msg.guild.member(bot.user).hasPermission('MANAGE_MESSAGES')) return msg.reply('I don\'t have permssion to manage messages');
const user = msg.mentions.users.first();
const amount = parseInt(args[0]) ? parseInt(args[0]) : parseInt(args[1]);
if (!amount) return msg.reply('How many message shall I delete?');