Browse Source

Prepend @ symbol to names shown in user list, so they highlight

(cherry picked from commit abfeb0c1cf)
master
Clif Gordon 10 months ago
committed by Zorchenhimer
parent
commit
de117eb5a9
1 changed files with 12 additions and 1 deletions
  1. +12
    -1
      chatcommands.go

+ 12
- 1
chatcommands.go View File

@ -213,7 +213,18 @@ var commands = &CommandControl{
HelpText: "Show a list of users in chat",
Function: func(cl *Client, args []string) (string, error) {
names := cl.belongsTo.GetNames()
return strings.Join(names, " "), nil
formatNames := func(names []string) []string {
result := make([]string, len(names))
for _, name := range names {
if strings.HasPrefix(name, "@") {
result = append(result, name)
} else {
result = append(result, "@"+name)
}
}
return result
}
return strings.Join(formatNames(names), " "), nil
},
},

Loading…
Cancel
Save