forked from Galactic/galactic-bot
usage embed
This commit is contained in:
parent
be5e7f5c72
commit
ca271b7590
@ -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<void>}
|
||||
* @memberof Setting
|
||||
*/
|
||||
fields() {
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an interaction collector that passes the control to onCollect
|
||||
* @param {InteractionWrapper} wrapper Interaction wrapper
|
||||
|
Loading…
Reference in New Issue
Block a user