From 337d0f3fecf129c24e7aa6f8b9d6efedc3ea4bf9 Mon Sep 17 00:00:00 2001 From: lyx0 Date: Sat, 23 Oct 2021 21:59:56 +0200 Subject: [PATCH] add commands --- pkg/commands/bttv.go | 13 +++++++++++++ pkg/commands/ffz.go | 13 +++++++++++++ pkg/handlers/command.go | 14 ++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 pkg/commands/bttv.go create mode 100644 pkg/commands/ffz.go diff --git a/pkg/commands/bttv.go b/pkg/commands/bttv.go new file mode 100644 index 0000000..17c90b2 --- /dev/null +++ b/pkg/commands/bttv.go @@ -0,0 +1,13 @@ +package commands + +import ( + "fmt" + + "github.com/lyx0/nourybot/cmd/bot" +) + +func Bttv(target string, emote string, nb *bot.Bot) { + reply := fmt.Sprintf("https://betterttv.com/emotes/shared/search?query=%s", emote) + + nb.Send(target, reply) +} diff --git a/pkg/commands/ffz.go b/pkg/commands/ffz.go new file mode 100644 index 0000000..251f5f5 --- /dev/null +++ b/pkg/commands/ffz.go @@ -0,0 +1,13 @@ +package commands + +import ( + "fmt" + + "github.com/lyx0/nourybot/cmd/bot" +) + +func Ffz(target string, emote string, nb *bot.Bot) { + reply := fmt.Sprintf("https://www.frankerfacez.com/emoticons/?q=%s", emote) + + nb.Send(target, reply) +} diff --git a/pkg/handlers/command.go b/pkg/handlers/command.go index 9813c75..1f28e23 100644 --- a/pkg/handlers/command.go +++ b/pkg/handlers/command.go @@ -46,6 +46,13 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) { return } + case "bttv": + if msgLen == 1 { + nb.Send(target, "Usage: ()bttv [emote]") + return + } + commands.Bttv(target, cmdParams[1], nb) + return case "bttvemotes": commands.BttvEmotes(target, nb) return @@ -92,6 +99,12 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) { case "emotelookup": commands.EmoteLookup(target, cmdParams[1], nb) + case "ffz": + if msgLen == 1 { + nb.Send(target, "Usage: ()ffz [emote]") + return + } + commands.Ffz(target, cmdParams[1], nb) case "ffzemotes": commands.FfzEmotes(target, nb) return @@ -277,6 +290,7 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) { commands.RandomQuote(target, cmdParams[1], cmdParams[2], nb) return } + case "randomxkcd": commands.RandomXkcd(target, nb) return