2021-10-19 23:53:41 +02:00
|
|
|
package commands
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
|
|
|
"github.com/lyx0/nourybot/cmd/bot"
|
|
|
|
"github.com/lyx0/nourybot/pkg/utils"
|
|
|
|
)
|
|
|
|
|
2021-10-31 14:57:21 +01:00
|
|
|
// Thumbnail responds with the current preview image for a given channel.
|
2021-10-24 17:52:24 +02:00
|
|
|
func Thumbnail(channel, target string, nb *bot.Bot) {
|
2021-10-19 23:53:41 +02:00
|
|
|
imageHeight := utils.GenerateRandomNumberRange(1040, 1080)
|
|
|
|
imageWidth := utils.GenerateRandomNumberRange(1890, 1920)
|
2021-10-20 23:54:34 +02:00
|
|
|
|
2021-10-19 23:53:41 +02:00
|
|
|
response := fmt.Sprintf("https://static-cdn.jtvnw.net/previews-ttv/live_user_%v-%vx%v.jpg", target, imageWidth, imageHeight)
|
|
|
|
|
|
|
|
nb.Send(channel, response)
|
|
|
|
}
|