galactic-bot/structure/interfaces/Setting.js
2020-05-04 19:35:01 -04:00

44 lines
1.0 KiB
JavaScript

const Component = require('./Component.js');
class Setting extends Component {
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 || [];
}
}
module.exports = Setting;
const Constants = {
Resolves: [
'GUILD',
'USER'
]
};