1
0
mirror of synced 2024-11-24 12:56:01 +03:00

Merge pull request #80 from Neur0toxine/master

[fix] send animation as file
This commit is contained in:
Alex Lushpai 2019-08-28 12:08:09 +03:00 committed by GitHub
commit eefb0fabad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -1029,6 +1029,10 @@ func setAttachment(attachments *tgbotapi.Message, client *v1.MgClient, snd *v1.S
snd.Message.Type = v1.MsgTypeImage
snd.Message.Note = attachments.Caption
case "animation":
fileID = attachments.Animation.FileID
snd.Message.Type = v1.MsgTypeFile
caption += ".mp4"
case "document":
fileID = attachments.Document.FileID
snd.Message.Type = v1.MsgTypeFile
@ -1061,6 +1065,17 @@ func setAttachment(attachments *tgbotapi.Message, client *v1.MgClient, snd *v1.S
if err != nil {
return err
}
case t == "animation":
item, _, err = getItemData(
client,
fileUrl,
caption,
)
if err != nil {
return err
}
item.Caption = item.ID + ".mp4"
default:
item, err = convertAndUploadImage(
client,

View File

@ -41,6 +41,8 @@ func getMessageID(data *tgbotapi.Message) string {
return "audio"
case data.Contact != nil:
return "contact"
case data.Animation != nil:
return "animation"
case data.Document != nil:
return "document"
case data.Location != nil: