forked from Galactic/galactic-bot
32 lines
735 B
JavaScript
32 lines
735 B
JavaScript
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;
|
|
this.index = `I_${opts.name.toUpperCase()}_ERROR`;
|
|
this.silent = opts.silent === undefined ? false : Boolean(opts.silent);
|
|
|
|
}
|
|
|
|
_succeed() {
|
|
return { error: false, inhibitor: this };
|
|
}
|
|
|
|
_fail(args) {
|
|
return { error: true, inhibitor: this, args };
|
|
}
|
|
|
|
}
|
|
|
|
module.exports = Inhibitor; |