add thumbnail command

This commit is contained in:
lyx0 2021-10-16 18:24:50 +02:00
parent dd1238a75e
commit 27c8505ee0
2 changed files with 36 additions and 0 deletions

16
pkg/commands/thumbnail.go Normal file
View file

@ -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)
}

View file

@ -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 {