diff --git a/chat/command.go b/chat/command.go index f6aa9bd..97bd513 100644 --- a/chat/command.go +++ b/chat/command.go @@ -173,9 +173,15 @@ func InitCommands(c *Commands) { Prefix: "/names", Help: "List users who are connected.", Handler: func(room *Room, msg message.CommandMsg) error { - // TODO: colorize - names := room.NamesPrefix("") - body := fmt.Sprintf("%d connected: %s", len(names), strings.Join(names, ", ")) + names := room.Members.ListPrefix("") + colNames := make([]string, len(names)) + theme := msg.From().Config().Theme + + for i, uname := range names { + colNames[i] = theme.ColorName(uname.Value().(*Member).User) + } + + body := fmt.Sprintf("%d connected: %s", len(colNames), strings.Join(colNames, ", ")) room.Send(message.NewSystemMsg(body, msg.From())) return nil },