From dd1238a75e04cbf5378c70a597a07d439c517222 Mon Sep 17 00:00:00 2001 From: lyx0 Date: Sat, 16 Oct 2021 18:24:39 +0200 Subject: [PATCH] add ffzemote commmand --- pkg/commands/ffzemotes.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 pkg/commands/ffzemotes.go diff --git a/pkg/commands/ffzemotes.go b/pkg/commands/ffzemotes.go new file mode 100644 index 0000000..a9a9975 --- /dev/null +++ b/pkg/commands/ffzemotes.go @@ -0,0 +1,26 @@ +package commands + +import ( + "fmt" + "io/ioutil" + "net/http" + + "github.com/gempir/go-twitch-irc/v2" + log "github.com/sirupsen/logrus" +) + +func FfzEmotes(channel string, client *twitch.Client) { + resp, err := http.Get(fmt.Sprintf("https://customapi.aidenwallis.co.uk/api/v1/emotes/%s/ffz", 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)) +}