mirror-nourybot/pkg/commands/bttvemotes.go
2021-10-16 18:06:34 +02:00

27 lines
481 B
Go

package commands
import (
"fmt"
"io/ioutil"
"net/http"
"github.com/gempir/go-twitch-irc/v2"
log "github.com/sirupsen/logrus"
)
func BttvEmotes(channel string, client *twitch.Client) {
resp, err := http.Get(fmt.Sprintf("https://customapi.aidenwallis.co.uk/api/v1/emotes/%s/bttv", channel))
if err != nil {
log.Fatalln(err)
}
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatalln(err)
}
client.Say(channel, string(body))
}