1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Haha-Yes/event/listeners/missingPermissions.js

32 lines
804 B
JavaScript

const { Listener } = require('discord-akairo');
class missingPermissionsListener extends Listener {
constructor() {
super('missingPermissions', {
emitter: 'commandHandler',
event: 'missingPermissions'
});
}
async exec(message, command, type, missing) {
switch(type) {
case 'client':
if (missing == 'SEND_MESSAGES') {
return;
} else {
message.reply(`Im missing the required permissions for this command!, \`${missing}\``);
}
break;
case 'user':
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;
}
}
}
module.exports = missingPermissionsListener;