2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-31 06:05:22 +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' +
customCommands
.filter(command => command.isActive)
.sort((a, b) => a.role < b.role)
.map(command => `[${command.role}] <code>!${command.name}</code>`)
.sort((a, b) => a.role.toLowerCase() < b.role.toLowerCase())
.map(command =>
`[${command.role.toLowerCase()}] ` +
`<code>!${command.name}</code>`)
.join('\n')
: '';
return replyWithHTML(commandReference + customCommandsText + actions);
};