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
1 changed files with 8 additions and 6 deletions

View File

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