mods: Make memegen work with replies

This commit is contained in:
Hamcha 2016-04-10 14:48:28 +02:00
parent 54dcccb892
commit ddc1ad0052
1 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,12 @@ func initmeme() {
}
func memegen(broker *tg.Broker, update tg.APIMessage) {
// Make replies work
if update.ReplyTo != nil && update.Text != nil && update.ReplyTo.Photo != nil {
update.Photo = update.ReplyTo.Photo
update.Caption = update.Text
}
if update.Photo != nil && update.Caption != nil {
caption := *(update.Caption)
if strings.HasPrefix(caption, "/meme ") && len(caption) > 6 {