mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-04-18 20:43:55 +02:00
Add aliases to help
This commit is contained in:
parent
de1e761623
commit
a0c5875ee4
1 changed files with 15 additions and 1 deletions
|
@ -30,7 +30,21 @@ export default class implements Command {
|
||||||
const {prefix} = settings;
|
const {prefix} = settings;
|
||||||
|
|
||||||
const res = this.commands.sort((a, b) => a.name.localeCompare(b.name)).reduce((content, command) => {
|
const res = this.commands.sort((a, b) => a.name.localeCompare(b.name)).reduce((content, command) => {
|
||||||
content += `**${command.name}**:\n`;
|
const aliases = command.aliases.reduce((str, alias, i) => {
|
||||||
|
str += alias;
|
||||||
|
|
||||||
|
if (i !== command.aliases.length - 1) {
|
||||||
|
str += ', ';
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}, '');
|
||||||
|
|
||||||
|
if (aliases === '') {
|
||||||
|
content += `**${command.name}**:\n`;
|
||||||
|
} else {
|
||||||
|
content += `**${command.name}** (${aliases}):\n`;
|
||||||
|
}
|
||||||
|
|
||||||
command.examples.forEach(example => {
|
command.examples.forEach(example => {
|
||||||
content += `- \`${prefix}${example[0]}\`: ${example[1]}\n`;
|
content += `- \`${prefix}${example[0]}\`: ${example[1]}\n`;
|
||||||
|
|
Loading…
Add table
Reference in a new issue