mirror of
https://github.com/diamondburned/cchat-discord.git
synced 2024-12-27 14:27:43 +00:00
23 lines
415 B
Go
23 lines
415 B
Go
package mention
|
|
|
|
import (
|
|
"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())
|
|
}
|