forked from 7cc5c4f330d47060/botv12-legacy
Add aliases to the help command
This commit is contained in:
parent
1fcb2f8ab8
commit
dad70f81bc
2 changed files with 41 additions and 2 deletions
commands
|
@ -171,6 +171,43 @@ const printCmdHelp = (c) => {
|
|||
}
|
||||
]
|
||||
})
|
||||
if(cmds[cmd].aliases){
|
||||
const aliasList = [];
|
||||
for(const item of cmds[cmd].aliases){
|
||||
if(aliasList.length>0){
|
||||
aliasList.push({
|
||||
text: ", ",
|
||||
color: c.colors.secondary
|
||||
})
|
||||
}
|
||||
aliasList.push({
|
||||
text: item,
|
||||
color: c.colors.primary,
|
||||
clickEvent: {
|
||||
action: 'copy_to_clipboard',
|
||||
value: item
|
||||
},
|
||||
hoverEvent: {
|
||||
action: 'show_text',
|
||||
contents: {
|
||||
text: getMessage(c.lang, 'command.help.copyAlias'),
|
||||
color: c.colors.secondary
|
||||
},
|
||||
value: { // Added twice for backwards compatibility
|
||||
text: getMessage(c.lang, 'command.help.copyAlias'),
|
||||
color: c.colors.secondary
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
c.reply({
|
||||
translate: getMessage(c.lang, 'command.help.commandAliases'),
|
||||
color: c.colors.secondary,
|
||||
with: [
|
||||
aliasList
|
||||
]
|
||||
})
|
||||
}
|
||||
const permsN = getMessage(c.lang, 'command.help.permsNormal')
|
||||
const permsT = getMessage(c.lang, 'command.help.permsTrusted')
|
||||
const permsO = getMessage(c.lang, 'command.help.permsOwner')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue