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.Type = v1.MsgTypeImage
|
||||||
snd.Message.Note = attachments.Caption
|
snd.Message.Note = attachments.Caption
|
||||||
|
case "animation":
|
||||||
|
fileID = attachments.Animation.FileID
|
||||||
|
snd.Message.Type = v1.MsgTypeFile
|
||||||
|
caption += ".mp4"
|
||||||
case "document":
|
case "document":
|
||||||
fileID = attachments.Document.FileID
|
fileID = attachments.Document.FileID
|
||||||
snd.Message.Type = v1.MsgTypeFile
|
snd.Message.Type = v1.MsgTypeFile
|
||||||
@ -1061,6 +1065,17 @@ func setAttachment(attachments *tgbotapi.Message, client *v1.MgClient, snd *v1.S
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
case t == "animation":
|
||||||
|
item, _, err = getItemData(
|
||||||
|
client,
|
||||||
|
fileUrl,
|
||||||
|
caption,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
item.Caption = item.ID + ".mp4"
|
||||||
default:
|
default:
|
||||||
item, err = convertAndUploadImage(
|
item, err = convertAndUploadImage(
|
||||||
client,
|
client,
|
||||||
|
@ -41,6 +41,8 @@ func getMessageID(data *tgbotapi.Message) string {
|
|||||||
return "audio"
|
return "audio"
|
||||||
case data.Contact != nil:
|
case data.Contact != nil:
|
||||||
return "contact"
|
return "contact"
|
||||||
|
case data.Animation != nil:
|
||||||
|
return "animation"
|
||||||
case data.Document != nil:
|
case data.Document != nil:
|
||||||
return "document"
|
return "document"
|
||||||
case data.Location != nil:
|
case data.Location != nil:
|
||||||
|
Loading…
Reference in New Issue
Block a user