Merge pull request #80 from Neur0toxine/master
[fix] send animation as file
This commit is contained in:
commit
eefb0fabad
@ -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,
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user