2020-04-08 18:08:46 +02:00
|
|
|
const Component = require('./Component.js');
|
|
|
|
|
|
|
|
class Inhibitor extends Component {
|
|
|
|
|
|
|
|
constructor(client, opts = {}) {
|
|
|
|
|
|
|
|
super(client, {
|
|
|
|
id: opts.name,
|
|
|
|
type: 'inhibitor',
|
|
|
|
guarded: opts.guarded,
|
|
|
|
disabled: opts.disabled
|
|
|
|
});
|
|
|
|
|
|
|
|
this.name = opts.name;
|
|
|
|
this.guild = Boolean(opts.guild);
|
|
|
|
this.priority = opts.priority || 1;
|
2020-05-25 13:13:34 +02:00
|
|
|
this.index = `I_${opts.name.toUpperCase()}_ERROR`;
|
2020-07-04 12:23:10 +02:00
|
|
|
this.silent = opts.silent === undefined ? false : Boolean(opts.silent);
|
2020-04-08 18:08:46 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
_succeed() {
|
|
|
|
return { error: false, inhibitor: this };
|
|
|
|
}
|
|
|
|
|
2020-05-25 13:13:34 +02:00
|
|
|
_fail(args) {
|
|
|
|
return { error: true, inhibitor: this, args };
|
2020-04-08 18:08:46 +02:00
|
|
|
}
|
2020-04-08 16:27:34 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Inhibitor;
|