aboutsummaryrefslogtreecommitdiff
path: root/events/message.js
diff options
context:
space:
mode:
Diffstat (limited to 'events/message.js')
-rw-r--r--events/message.js12
1 files changed, 9 insertions, 3 deletions
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 {