forked from wallerdev/go-twitch
/
chat.go
41 lines (32 loc) · 943 Bytes
/
chat.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
41
// Streams methods of the twitch api.
// https://github.com/justintv/Twitch-API/blob/master/v3_resources/chat.md
package twitch
type ChatLinks struct {
Links ChatLinksS `json:"_links,omitempty"`
}
type ChatLinksS struct {
Emoticons string `json:"emoticons,omitempty"`
Badges string `json:"badges,omitempty"`
}
type EmoticonsS struct {
Emoticons []EmoticonS `json:"emoticons,omitempty"`
}
type EmoticonS struct {
Regex string `json:"regex,omitempty"`
Images []ImageS `json:"images,omitempty"`
}
type ImageS struct {
EmoticonSet int `json:"emoticon_set,omitempty"`
Height int `json:"height,omitempty"`
Width int `json:"width,omitempty"`
Url string `json:"url,omitempty"`
}
type ChatMethod struct {
client *Client
}
func (c *ChatMethod) Emoticons() (*EmoticonsS, error) {
rel := "chat/emoticons"
emoticons := new(EmoticonsS)
_, err := c.client.Get(rel, emoticons)
return emoticons, err
}