1
0
mirror of synced 2024-11-21 20:16:02 +03:00

Merge pull request #68 from DmitryZagorulko/master

correct file caption
This commit is contained in:
Alex Lushpai 2019-01-29 15:37:30 +03:00 committed by GitHub
commit 02bfad6ad3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -923,6 +923,7 @@ func photoMessage(items []v1.FileItem, mgClient *v1.MgClient, cid int64) (chatta
msg := tgbotapi.NewPhotoUpload(cid, nil)
msg.FileID = file.Url
msg.UseExisting = true
msg.Caption = v[0].Caption
chattable = msg
} else if len(items) > 1 {
@ -939,6 +940,7 @@ func photoMessage(items []v1.FileItem, mgClient *v1.MgClient, cid int64) (chatta
}
ip := tgbotapi.NewInputMediaPhoto(file.Url)
ip.Caption = v.Caption
it = append(it, ip)
}
@ -1007,7 +1009,7 @@ func setAttachment(attachments *tgbotapi.Message, client *v1.MgClient, snd *v1.S
}
snd.Message.Type = v1.MsgTypeImage
caption = getLocalizedMessage(t)
caption = attachments.Caption
case "document":
fileID = attachments.Document.FileID
snd.Message.Type = v1.MsgTypeFile
@ -1015,7 +1017,7 @@ func setAttachment(attachments *tgbotapi.Message, client *v1.MgClient, snd *v1.S
case "sticker":
fileID = attachments.Sticker.FileID
snd.Message.Type = v1.MsgTypeImage
caption = getLocalizedMessage(t)
caption = attachments.Caption
default:
snd.Message.Text = getLocalizedMessage(t)
}