1
0
Fork 0
mirror of https://github.com/diamondburned/cchat-discord.git synced 2024-11-01 12:24:15 +00:00
cchat-discord/internal/segments/mention/role.go

23 lines
415 B
Go
Raw Normal View History

package mention
import (
2020-12-20 05:44:26 +00:00
"github.com/diamondburned/arikawa/v2/discord"
"github.com/diamondburned/cchat-discord/internal/segments/colored"
"github.com/diamondburned/cchat/text"
)
type Role struct {
discord.Role
}
func NewRole(role discord.Role) *Role {
return &Role{role}
}
func (r *Role) Color() uint32 {
if r.Role.Color == 0 {
return colored.Blurple
}
return text.SolidColor(r.Role.Color.Uint32())
}