From 3cc2cefd9d1710109406d69816a7c89264a61826 Mon Sep 17 00:00:00 2001 From: Maxim Oransky Date: Tue, 27 Oct 2020 01:41:45 +0300 Subject: [PATCH] message uploads --- features.go | 4 ++-- message.go | 25 ++++++++++++++----------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/features.go b/features.go index c4ae7c6..df7bb42 100644 --- a/features.go +++ b/features.go @@ -41,8 +41,8 @@ type Features struct { // Maximum number of forwarded messages MaxLinkedMessages int `json:"max_linked_messages"` - // Maximum number of message attachments - MaxMessageAttachments int `json:"max_message_attachments"` + // Maximum number of message uploads + MaxMessageUploads int `json:"max_message_uploads"` // Maximum chars for: family_name, given_name, patronymic if any MaxUsernamePartLength int `json:"max_username_part_length"` diff --git a/message.go b/message.go index 1c7bd9d..5d3d7b7 100644 --- a/message.go +++ b/message.go @@ -37,37 +37,40 @@ type MessageContent struct { // Message subtype, if any Subtype Mediasubtype `json:"subtype,omitempty"` - // Upload id, if any + // Message uploads + Uploads []Upload `json:"uploads,omitempty"` + + // Upload id, if any. Depreacted: use Uploads instead Upload string `mediatype:"audiomsg,image,video,file" json:"upload,omitempty"` - // Upload url, if any + // Upload url, if any. Depreacted: use Uploads instead MediaUrl string `mediatype:"audiomsg,image,video,file" json:"mediaURL,omitempty"` - // Upload size, if any + // Upload size, if any. Depreacted: use Uploads instead Size int `mediatype:"audiomsg,image,video,file" json:"size,omitempty"` - // Upload duration, if any + // Upload duration, if any. Depreacted: use Uploads instead Duration *uint `mediatype:"audiomsg,video" json:"duration,omitempty"` - // Upload stil processing, if any + // Upload stil processing, if any. Depreacted: use Uploads instead Processing bool `mediatype:"video" json:"processing,omitempty"` - // Upload preview height, in pixels, if any + // Upload preview height, in pixels, if any. Depreacted: use Uploads instead PreviewHeight int `mediatype:"image,video" json:"previewHeight,omitempty"` - // Upload width, in pixels, if any + // Upload width, in pixels, if any. Depreacted: use Uploads instead PreviewWidth int `mediatype:"image,video" json:"previewWidth,omitempty"` - // Upload preview absolute url, if any + // Upload preview absolute url, if any. Depreacted: use Uploads instead PreviewUrl string `mediatype:"image,video" json:"previewURL,omitempty"` - // Upload high resolution preview absolute url, if any + // Upload high resolution preview absolute url, if any. Depreacted: use Uploads instead Preview2xUrl string `mediatype:"image,video" json:"preview2xURL,omitempty"` - // Upload name, if any + // Upload name, if any. Depreacted: use Uploads instead Name string `mediatype:"image,video,file" json:"name,omitempty"` - // Upload is animated image, if any + // Upload is animated image, if any. Depreacted: use Uploads instead Animated bool `mediatype:"image" json:"animated,omitempty"` // Change title (for "change" mediatype)