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