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
Raw Normal View History

2016-02-15 16:52:25 +00:00
package main
import (
"fmt"
2016-02-15 16:52:25 +00:00
"strings"
"github.com/hamcha/clessy/tg"
)
func memegen(broker *tg.Broker, update tg.APIMessage) {
if update.Photo != nil && update.Caption != nil {
2016-02-15 16:52:25 +00:00
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)
2016-02-15 16:52:25 +00:00
}
}
}