-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchats.go
40 lines (32 loc) · 854 Bytes
/
chats.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
38
39
40
package twch
type Chats struct {
client *Client
}
type listEmoticons struct {
Emoticons []Emoticon `json:"emoticons,omitempty"`
Links interface{} `json:"_links,omitempty"`
}
type EmoticonImage struct {
EmoticonSet *int `json:"emoticon_set,omitempty"`
Height *int `json:"height,omitempty"`
Width *int `json:"width,omitempty"`
URL *string `json:"url,omitempty"`
}
type Emoticon struct {
Regex *string `json:"regex"`
Images []EmoticonImage `json:"images"`
}
// ListEmoticons returns a list of all the emoticons on Twitch
func (c *Chats) ListEmoticons() (e []Emoticon, resp *Response, err error) {
req, err := c.client.NewRequest("GET", "chat/emoticons")
if err != nil {
return
}
r := new(listEmoticons)
resp, err = c.client.Do(req, r)
if err != nil {
return
}
e = r.Emoticons
return
}