galactic-bot/structure/client/components/inhibitors/MemberPermissions.js

27 lines
623 B
JavaScript

const { Inhibitor } = require('../../../interfaces/');
class MemberPermissions extends Inhibitor {
constructor(client) {
super(client, {
name: 'memberPermissions',
priority: 10,
guarded: true,
guild: true
});
}
execute(message, command) {
const missing = message.channel.permissionsFor(message.member).missing(command.memberPermissions);
if(missing.length > 0) {
return super._fail({ missing: missing.join(', ') });
}
return super._succeed();
}
}
module.exports = MemberPermissions;