2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-09-01 22:55:24 +00:00

sort and show all custom command roles in lowercase

This commit is contained in:
Pouria Ezzati
2017-10-11 22:51:44 +03:30
parent 846375f96c
commit a160e992fa

View File

@@ -36,11 +36,12 @@ const commandReferenceHandler = async ({ chat, replyWithHTML }) => {
? '\n<b>Custom commands:</b>\n' + ? '\n<b>Custom commands:</b>\n' +
customCommands customCommands
.filter(command => command.isActive) .filter(command => command.isActive)
.sort((a, b) => a.role < b.role) .sort((a, b) => a.role.toLowerCase() < b.role.toLowerCase())
.map(command => `[${command.role}] <code>!${command.name}</code>`) .map(command =>
`[${command.role.toLowerCase()}] ` +
`<code>!${command.name}</code>`)
.join('\n') .join('\n')
: ''; : '';
return replyWithHTML(commandReference + customCommandsText + actions); return replyWithHTML(commandReference + customCommandsText + actions);
}; };