1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2024-11-28 01:33:10 +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 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"
} }