mirror of
https://github.com/diamondburned/cchat-discord.git
synced 2024-11-01 12:24:15 +00:00
23 lines
412 B
Go
23 lines
412 B
Go
|
package mention
|
||
|
|
||
|
import (
|
||
|
"github.com/diamondburned/arikawa/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())
|
||
|
}
|