-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathget_emotes.go
44 lines (39 loc) · 1008 Bytes
/
get_emotes.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
42
43
44
package main
import (
"github.com/Sadzeih/bttv-telegram/pkg/emote"
"github.com/Sadzeih/bttv-telegram/pkg/seventv"
"github.com/Sadzeih/bttv-telegram/pkg/twitch"
)
func getEmotes(query string) ([]emote.Emote, error) {
twitchEmotes, err := twitch.GlobalEmotes()
if err != nil {
return nil, err
}
//searchBTTV, err := bttv.SearchEmotes(query)
//if err != nil {
// return nil, err
//}
//globalBttv, err := bttv.GlobalEmotes()
//if err != nil {
// return nil, err
//}
stv, err := seventv.SearchEmotes(query)
if err != nil {
return nil, err
}
emotes := make([]emote.Emote, len(twitchEmotes)+len(stv))
for i, e := range twitchEmotes {
emotes[i] = e.Convert()
}
//for i, e := range searchBTTV {
// emotes[i+len(twitchEmotes)] = e.Convert()
//}
//for i, e := range globalBttv {
// emotes[i+len(twitchEmotes)+len(searchBTTV)] = e.Convert()
//}
for i, e := range stv {
emotes[i+len(twitchEmotes)] = e.Convert()
}
emotes = emote.SearchEmotes(query, emotes)
return emotes, nil
}