This repository has been archived on 2023-07-05. You can view files and clone it, but cannot push or open issues or pull requests.
clessy/mods/memegen.go

25 lines
447 B
Go

package main
import (
"fmt"
"strings"
"github.com/hamcha/clessy/tg"
)
func memegen(broker *tg.Broker, update tg.APIMessage) {
if update.Photo != nil && update.Caption != nil {
if strings.HasPrefix(*(update.Caption), "/meme") {
maxsz := 0
photo := tg.APIPhotoSize{}
for _, curphoto := range update.Photo {
if curphoto.Width > maxsz {
maxsz = curphoto.Width
photo = curphoto
}
}
fmt.Println(photo)
}
}
}