From 7461ca8e390f317f9a2a914d821558bc0e58b24a Mon Sep 17 00:00:00 2001 From: Andrey Petrov Date: Mon, 3 Aug 2020 13:57:11 -0400 Subject: [PATCH] chat/message: Use user.ID() names for mono bot theme --- chat/message/theme.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/chat/message/theme.go b/chat/message/theme.go index 10c3280a..08e49788 100644 --- a/chat/message/theme.go +++ b/chat/message/theme.go @@ -122,6 +122,7 @@ type Theme struct { pm Style highlight Style names *Palette + useID bool } func (theme Theme) ID() string { @@ -130,11 +131,17 @@ func (theme Theme) ID() string { // Colorize name string given some index func (theme Theme) ColorName(u *User) string { + var name string + if theme.useID { + name = u.ID() + } else { + name = u.Name() + } if theme.names == nil { - return u.Name() + return name } - return theme.names.Get(u.colorIdx).Format(u.Name()) + return theme.names.Get(u.colorIdx).Format(name) } // Colorize the PM string @@ -226,7 +233,8 @@ func init() { highlight: style(Bold + "\033[48;5;22m\033[38;5;46m"), // Green on dark green }, { - id: "mono", + id: "mono", + useID: true, }, }