From ded76a871e5ec6e5e10720f8a2b4aa870ea4af0d Mon Sep 17 00:00:00 2001 From: Rustam Gilyazov <16064414+rusq@users.noreply.github.com> Date: Mon, 5 Apr 2021 20:34:22 +1200 Subject: [PATCH 1/2] add caption to Voice --- media.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/media.go b/media.go index 79277f7..13b7134 100644 --- a/media.go +++ b/media.go @@ -161,7 +161,8 @@ type Voice struct { Duration int `json:"duration"` // (Optional) - MIME string `json:"mime_type,omitempty"` + Caption string `json:"caption,omitempty"` + MIME string `json:"mime_type,omitempty"` } // VideoNote represents a video message (available in Telegram apps From 97480382eac892e62e7b0d500f2aa33751b8f611 Mon Sep 17 00:00:00 2001 From: Rustam Gilyazov <16064414+rusq@users.noreply.github.com> Date: Mon, 5 Apr 2021 20:40:31 +1200 Subject: [PATCH 2/2] update sendable to include voice.caption --- sendable.go | 1 + 1 file changed, 1 insertion(+) diff --git a/sendable.go b/sendable.go index 08b1327..7036de8 100644 --- a/sendable.go +++ b/sendable.go @@ -213,6 +213,7 @@ func (a *Animation) Send(b *Bot, to Recipient, opt *SendOptions) (*Message, erro func (v *Voice) Send(b *Bot, to Recipient, opt *SendOptions) (*Message, error) { params := map[string]string{ "chat_id": to.Recipient(), + "caption": v.Caption, } b.embedSendOptions(params, opt)