-
Notifications
You must be signed in to change notification settings - Fork 0
/
emoji.go
37 lines (30 loc) · 830 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
37
package httpcord
type Emoji struct {
ID Snowflake `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Roles []*Snowflake `json:"roles,omitempty"`
User *User `json:"user,omitempty"`
RequireColons bool `json:"require_colons,omitempty"`
Managed bool `json:"managed,omitempty"`
Animated bool `json:"animated,omitempty"`
Available bool `json:"available,omitempty"`
}
func (e *Emoji) Mention() string {
if e.ID.String() != "" {
m := "<"
if e.Animated {
m += "a"
}
m += ":" + e.Name + ":" + e.ID.String() + ">"
return m
}
return e.Name
}
func (e *Emoji) String() string {
return e.Mention()
}
type Reaction struct {
Count int `json:"count"`
Me bool `json:"me"`
Emoji Emoji `json:"emoji"`
}