galactic-bot/structure/interfaces/Setting.js

44 lines
1.0 KiB
JavaScript
Raw Normal View History

2020-04-08 18:08:46 +02:00
const Component = require('./Component.js');
2020-04-08 16:27:34 +02:00
2020-04-08 18:08:46 +02:00
class Setting extends Component {
2020-04-08 16:27:34 +02:00
2020-04-08 18:08:46 +02:00
constructor(client, opts = {}) {
if(!opts) return null;
super(client, {
id: opts.name,
type: 'setting',
guarded: opts.guarded,
disabled: opts.disabled
});
this.name = opts.name;
this.module = opts.module;
this.restricted = Boolean(opts.restricted);
this.description = opts.description || "A basic setting.";
this.archiveable = Boolean(opts.archiveable);
this.index = opts.index || opts.name;
this.aliases = opts.aliases || [];
this.resolve = (opts.resolve && Constants.Resolves.includes(opts.resolve)) ? opts.resolve : 'GUILD';
this.default = opts.default;
this.memberPermissions = opts.memberPermissions || [];
this.clientPermissions = opts.clientPermissions || [];
}
2020-04-08 16:27:34 +02:00
}
2020-04-08 18:08:46 +02:00
module.exports = Setting;
const Constants = {
Resolves: [
'GUILD',
'USER'
]
};