diff --git a/src/structure/interfaces/Setting.js b/src/structure/interfaces/Setting.js index fc50fa8..b85b206 100644 --- a/src/structure/interfaces/Setting.js +++ b/src/structure/interfaces/Setting.js @@ -65,6 +65,8 @@ class Setting extends Component { this.default = { [this.name]: options.default || {} }; + this.commandOptions = options.commandOptions || []; + } /** @@ -79,6 +81,37 @@ class Setting extends Component { hook.collector = await this.collector(wrapper, selectMenu); } + usageEmbed(guild, verbose = false) { + + const fields = []; + + if (this.commandOptions.length) { + fields.push({ + name: `》 ${guild.format(`GENERAL_OPTIONS`)}`, + value: this.commandOptions.map((opt) => `**${opt.name} [${opt.type}]:** ${opt.description} ${opt.choices.length ? `\n__${guild.format('GENERAL_CHOICES')}__\n\t${opt.choices.map((choice) => choice.name).join('\n\t')}` : ''}`).join('\n') + }); + } + + return { + author: { + name: `${this.display} [module:${this.module.name}]` + }, + description: this.description, + fields + }; + + } + + /** + * Should return fields with current setting values + * @abstract + * @return {Array} + * @memberof Setting + */ + fields() { + return []; + } + /** * Creates an interaction collector that passes the control to onCollect * @param {InteractionWrapper} wrapper Interaction wrapper