Files
xiao/framework/Argument.js
T
2021-06-05 12:17:33 -04:00

21 lines
577 B
JavaScript

const UnionType = require('./UnionType');
module.exports = class Argument {
constructor(client, options) {
Object.defineProperty(this, 'client', { value: client });
this.key = options.key.toLowerCase();
this.typeID = options.type.toLowerCase();
this.min = options.min;
this.max = options.max;
this.oneOf = options.oneOf;
this.default = options.default;
this.avatarSize = options.avatarSize || 2048;
}
get type() {
if (this.typeID.includes('|')) return new UnionType(this.client, this.typeID);
return this.client.registry.types.get(this.typeID);
}
};