Send the missing perm in DM if the bot can't send messages
This commit is contained in:
parent
b68dcc5ce7
commit
2c43a6835e
1 changed files with 11 additions and 4 deletions
|
@ -9,14 +9,21 @@ class missingPermissionsListener extends Listener {
|
||||||
}
|
}
|
||||||
|
|
||||||
async exec(message, command, type, missing) {
|
async exec(message, command, type, missing) {
|
||||||
if (missing == 'SEND_MESSAGES') return; // If bot can't send messages just do nothing
|
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case 'client':
|
case 'client':
|
||||||
message.reply(`Im missing the required permissions for this command!, \`${missing}\``);
|
if (missing == 'SEND_MESSAGES') {
|
||||||
|
return message.author.send(`Im missing the required permissions for this command!, \`${missing}\``);
|
||||||
|
} else {
|
||||||
|
message.reply(`Im missing the required permissions for this command!, \`${missing}\``);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'user':
|
case 'user':
|
||||||
message.reply(`You are missing some permissions to use this command!, \`${missing}\``);
|
if (missing == 'SEND_MESSAGES') {
|
||||||
|
return message.author.send(`You are missing some permissions to use this command!, \`${missing}\``);
|
||||||
|
} else {
|
||||||
|
message.reply(`You are missing some permissions to use this command!, \`${missing}\``);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue