diff --git a/pkg/commands/thumbnail.go b/pkg/commands/thumbnail.go new file mode 100644 index 0000000..311257c --- /dev/null +++ b/pkg/commands/thumbnail.go @@ -0,0 +1,16 @@ +package commands + +import ( + "fmt" + + "github.com/gempir/go-twitch-irc/v2" + "github.com/lyx0/nourybot/pkg/utils" +) + +func Thumbnail(channel string, target string, client *twitch.Client) { + imageHeight := utils.GenerateRandomNumberRange(1040, 1080) + imageWidth := utils.GenerateRandomNumberRange(1890, 1920) + response := fmt.Sprintf("https://static-cdn.jtvnw.net/previews-ttv/live_user_%v-%vx%v.jpg", target, imageWidth, imageHeight) + + client.Say(channel, response) +} diff --git a/pkg/handlers/command.go b/pkg/handlers/command.go index 6eaf9c0..8830cad 100644 --- a/pkg/handlers/command.go +++ b/pkg/handlers/command.go @@ -64,6 +64,9 @@ func HandleCommand(message twitch.PrivateMessage, twitchClient *twitch.Client, u case "8ball": commands.EightBall(message, twitchClient) return + case "ffzemotes": + commands.FfzEmotes(message.Channel, twitchClient) + return case "fill": if msgLen == 1 { twitchClient.Say(message.Channel, "Usage: ()fill [emote]") @@ -109,6 +112,23 @@ func HandleCommand(message twitch.PrivateMessage, twitchClient *twitch.Client, u return } else { commands.Subage(message.Channel, cmdParams[1], cmdParams[2], twitchClient) + return + } + case "thumb": + if msgLen == 1 { + twitchClient.Say(message.Channel, "Usage: ()thumbnail [channel]") + return + } else { + commands.Thumbnail(message.Channel, cmdParams[1], twitchClient) + return + } + case "thumbnail": + if msgLen == 1 { + twitchClient.Say(message.Channel, "Usage: ()thumbnail [channel]") + return + } else { + commands.Thumbnail(message.Channel, cmdParams[1], twitchClient) + return } case "uptime": if msgLen == 1 {