2020-04-17 17:23:13 +02:00
|
|
|
const { Inhibitor } = require('../../../interfaces/');
|
2020-04-16 14:37:04 +02:00
|
|
|
|
|
|
|
class Disabled extends Inhibitor {
|
|
|
|
|
|
|
|
constructor(client) {
|
|
|
|
|
|
|
|
super(client, {
|
|
|
|
name: 'disabled',
|
2020-07-04 12:23:10 +02:00
|
|
|
priority: 9,
|
|
|
|
silent: true
|
2020-04-16 14:37:04 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
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) });
|
2020-08-04 11:35:48 +02:00
|
|
|
if(message.guild && message.guild._settings.disabledCommands.includes(command.resolveable)) {
|
2020-07-28 05:00:24 +02:00
|
|
|
return super._fail({ modifier: message.format('I_DISABLED_ERRORMODIFIER', { globally: false }, true) });
|
|
|
|
}
|
|
|
|
|
2020-05-21 12:47:58 +02:00
|
|
|
return super._succeed();
|
2020-04-16 14:37:04 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-05-21 12:47:58 +02:00
|
|
|
module.exports = Disabled;
|