From 2c3bf24f5996753df4a2d4456949fc0b636f6366 Mon Sep 17 00:00:00 2001 From: Justin Date: Wed, 30 Oct 2019 22:28:49 -0400 Subject: Added an optional checkPermission function and upgraded quick.db. --- events/message.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'events/message.js') diff --git a/events/message.js b/events/message.js index d485ed3..21463a7 100644 --- a/events/message.js +++ b/events/message.js @@ -50,9 +50,15 @@ function parseCommand(bot, msg) { } if (cmd) { - if (cmd.conf.guildOnly == true) { - if (!msg.channel.guild) { - return msg.reply('This command can only be ran in a guild.'); + if (cmd.conf.guildOnly == true && !msg.channel.guild) { + return msg.reply('This command can only be ran in a guild.'); + } + if (cmd.checkPermission != null) { + let result = cmd.checkPermission(bot, msg.member) + if (result != true) + { + if (result == false) return msg.reply('You are not authorized to run this command.'); + return msg.reply(result); } } try { -- cgit v1.2.3