forked from andersfylling/disgord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
emoji.go
36 lines (30 loc) · 927 Bytes
/
emoji.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package resource
import . "github.com/andersfylling/snowflake"
// Emoji
type Emoji struct {
ID Snowflake `json:"id"`
Name string `json:"name"`
Roles []Snowflake `json:"roles,omitempty"`
User *User `json:"user,omitempty"` // the user who created the emoji
RequireColons bool `json:"require_colons,omitempty"`
Managed bool `json:"managed,omitempty"`
Animated bool `json:"animated,omitempty"`
}
type PartialEmoji = Emoji
// Mention
// TODO: review
func (e *Emoji) Mention() string {
return "<" + e.Name + ":" + e.ID.String() + ">"
}
// MentionAnimated add the animation prefix if a animated emoji
// TODO: review
func (e *Emoji) MentionAnimated() string {
prefix := ""
if e.Animated {
prefix = "a:"
}
return "<" + prefix + e.Name + ":" + e.ID.String() + ">"
}
func (e *Emoji) Clear() {
// obviously don't delete the user ...
}