1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-27 17:23:00 +00:00

Bot: Descriptions now show next to arguments

This commit is contained in:
diamondburned (Forefront) 2020-04-10 20:17:55 -07:00
parent 06136b7d5f
commit e0a002cc6d

View file

@ -256,15 +256,17 @@ func (sub *Subcommand) Help(indent string, hideAdmin bool) string {
commands += indent + cmd.Command
}
switch usage := cmd.Usage(); {
case len(usage) > 0:
for _, usage := range usage {
commands += " " + underline(usage)
}
case cmd.Description != "":
// Write the usages first.
for _, usage := range cmd.Usage() {
commands += " " + underline(usage)
}
// Write the description if there's any.
if cmd.Description != "" {
commands += ": " + cmd.Description
}
// Add a new line if this isn't the last command.
if i != len(sub.Commands)-1 {
commands += "\n"
}