mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
18 lines
489 B
Go
18 lines
489 B
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/lyx0/nourybot/pkg/common"
|
|
)
|
|
|
|
// Preview returns a link to an almost live image of a given twitch stream
|
|
// if the channel is currently live.
|
|
func Preview(channel string) string {
|
|
imageHeight := common.GenerateRandomNumberRange(1040, 1080)
|
|
imageWidth := common.GenerateRandomNumberRange(1890, 1920)
|
|
|
|
reply := fmt.Sprintf("https://static-cdn.jtvnw.net/previews-ttv/live_user_%v-%vx%v.jpg", channel, imageWidth, imageHeight)
|
|
return reply
|
|
}
|