mods: Make memegen work with replies
This commit is contained in:
parent
54dcccb892
commit
ddc1ad0052
1 changed files with 6 additions and 0 deletions
|
@ -36,6 +36,12 @@ func initmeme() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func memegen(broker *tg.Broker, update tg.APIMessage) {
|
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 {
|
if update.Photo != nil && update.Caption != nil {
|
||||||
caption := *(update.Caption)
|
caption := *(update.Caption)
|
||||||
if strings.HasPrefix(caption, "/meme ") && len(caption) > 6 {
|
if strings.HasPrefix(caption, "/meme ") && len(caption) > 6 {
|
||||||
|
|
Reference in a new issue