Fixed more mentions being black
This commit is contained in:
parent
bb2430a4a5
commit
3c1d6f1d3f
|
@ -60,7 +60,7 @@ func (m MentionSegment) Bounds() (start, end int) {
|
||||||
|
|
||||||
// Color tries to return the color of the mention segment, or it returns the
|
// Color tries to return the color of the mention segment, or it returns the
|
||||||
// usual blurple if none.
|
// usual blurple if none.
|
||||||
func (m MentionSegment) Color() uint32 {
|
func (m MentionSegment) Color() (color uint32) {
|
||||||
// Try digging through what we have for a color.
|
// Try digging through what we have for a color.
|
||||||
switch {
|
switch {
|
||||||
case m.GuildUser != nil && m.GuildUser.Member != nil:
|
case m.GuildUser != nil && m.GuildUser.Member != nil:
|
||||||
|
@ -69,12 +69,14 @@ func (m MentionSegment) Color() uint32 {
|
||||||
return blurple
|
return blurple
|
||||||
}
|
}
|
||||||
|
|
||||||
if color := discord.MemberColor(*g, *m.GuildUser.Member); color > 0 {
|
color = discord.MemberColor(*g, *m.GuildUser.Member).Uint32()
|
||||||
return color.Uint32()
|
|
||||||
}
|
|
||||||
|
|
||||||
case m.GuildRole != nil && m.GuildRole.Color > 0:
|
case m.GuildRole != nil && m.GuildRole.Color > 0:
|
||||||
return m.GuildRole.Color.Uint32()
|
color = m.GuildRole.Color.Uint32()
|
||||||
|
}
|
||||||
|
|
||||||
|
if color > 0 {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
return blurple
|
return blurple
|
||||||
|
|
Loading…
Reference in New Issue