diff options
| author | Justin <jtsshieh@outlook.com> | 2019-10-30 22:28:49 -0400 |
|---|---|---|
| committer | Justin <jtsshieh@outlook.com> | 2019-10-30 22:28:49 -0400 |
| commit | 2c3bf24f5996753df4a2d4456949fc0b636f6366 (patch) | |
| tree | 27700e9b0557d23a6fb0cbd9d4058d60d725caa0 /commands/Moderation/purge.js | |
| parent | 5d778acf2066546de30f53d4d10c92a043a44a3a (diff) | |
| download | PokeBot-2c3bf24f5996753df4a2d4456949fc0b636f6366.tar.gz PokeBot-2c3bf24f5996753df4a2d4456949fc0b636f6366.tar.bz2 PokeBot-2c3bf24f5996753df4a2d4456949fc0b636f6366.zip | |
Added an optional checkPermission function and upgraded quick.db.
Diffstat (limited to 'commands/Moderation/purge.js')
| -rw-r--r-- | commands/Moderation/purge.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/commands/Moderation/purge.js b/commands/Moderation/purge.js index 6ce557c..f244960 100644 --- a/commands/Moderation/purge.js +++ b/commands/Moderation/purge.js @@ -8,7 +8,6 @@ * *************************************/ exports.run = async (bot, msg, args) => { - if (!msg.member.hasPermission('MANAGE_MESSAGES')) return msg.reply('You don\'t have permission to manage messages.'); if (!msg.guild.member(bot.user).hasPermission('MANAGE_MESSAGES')) return msg.reply('I don\'t have permission to manage messages.'); const user = msg.mentions.users.first(); @@ -27,6 +26,11 @@ exports.run = async (bot, msg, args) => { msg.channel.bulkDelete(msgs).catch(error => console.log(error.stack)); }; +exports.checkPermission = (bot, member) => { + if (!member.hasPermission('MANAGE_MESSAGES')) return 'You don\'t have permission to manage messages.'; + return true; +} + exports.conf = { aliases: ['prune', 'rm'], guildOnly: true, |
