Send the missing perm in DM if the bot can't send messages

merge-requests/4/head
loicbersier 5 years ago
parent b68dcc5ce7
commit 2c43a6835e

@ -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…
Cancel
Save