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

30 lines
759 B
JavaScript
Raw Normal View History

const { Inhibitor } = require('../../../interfaces/');
class Disabled extends Inhibitor {
constructor(client) {
super(client, {
name: 'disabled',
priority: 9,
silent: true
});
Object.defineProperty(this, 'client', { value: client });
}
execute(message, command) {
2020-07-28 05:00:24 +02:00
if(command.disabled) return super._fail({ modifier: message.format('I_DISABLED_ERRORMODIFIER', { globally: true }, true) });
if(message.guild._settings.disabledCommands.includes(command.resolveable)) {
return super._fail({ modifier: message.format('I_DISABLED_ERRORMODIFIER', { globally: false }, true) });
}
return super._succeed();
}
}
module.exports = Disabled;