Merge pull request #388 from rusq/v2

Add Caption parameter to Voice structure
This commit is contained in:
demget 2021-04-07 10:41:50 +03:00 committed by GitHub
commit 62cfa356f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -161,6 +161,7 @@ type Voice struct {
Duration int `json:"duration"`
// (Optional)
Caption string `json:"caption,omitempty"`
MIME string `json:"mime_type,omitempty"`
}

View File

@ -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)