diff --git a/src/routing.go b/src/routing.go index f50a528..be48f96 100644 --- a/src/routing.go +++ b/src/routing.go @@ -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, diff --git a/src/telegram.go b/src/telegram.go index f191c93..cf6da0e 100644 --- a/src/telegram.go +++ b/src/telegram.go @@ -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: