From 6bf83a81850e31b0f3068def45a1d24ceaab968c Mon Sep 17 00:00:00 2001 From: Jqs7 <7@jqs7.com> Date: Wed, 5 Aug 2015 09:55:48 +0800 Subject: [PATCH] add sendAudio duration --- methods.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/methods.go b/methods.go index 9c8474d..7b25dc3 100644 --- a/methods.go +++ b/methods.go @@ -69,6 +69,7 @@ type PhotoConfig struct { // AudioConfig contains information about a SendAudio request. type AudioConfig struct { ChatID int + Duration int ReplyToMessageID int ReplyMarkup interface{} UseExistingAudio bool @@ -401,6 +402,9 @@ func (bot *BotAPI) SendAudio(config AudioConfig) (Message, error) { if config.ReplyToMessageID != 0 { v.Add("reply_to_message_id", strconv.Itoa(config.ReplyToMessageID)) } + if config.Duration != 0 { + v.Add("duration", strconv.Itoa(config.Duration)) + } if config.ReplyMarkup != nil { data, err := json.Marshal(config.ReplyMarkup) if err != nil {