add sendAudio duration

bot-api-6.1
Jqs7 2015-08-05 09:55:48 +08:00
parent 96a104444e
commit 6bf83a8185
1 changed files with 4 additions and 0 deletions

View File

@ -69,6 +69,7 @@ type PhotoConfig struct {
// AudioConfig contains information about a SendAudio request. // AudioConfig contains information about a SendAudio request.
type AudioConfig struct { type AudioConfig struct {
ChatID int ChatID int
Duration int
ReplyToMessageID int ReplyToMessageID int
ReplyMarkup interface{} ReplyMarkup interface{}
UseExistingAudio bool UseExistingAudio bool
@ -401,6 +402,9 @@ func (bot *BotAPI) SendAudio(config AudioConfig) (Message, error) {
if config.ReplyToMessageID != 0 { if config.ReplyToMessageID != 0 {
v.Add("reply_to_message_id", strconv.Itoa(config.ReplyToMessageID)) 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 { if config.ReplyMarkup != nil {
data, err := json.Marshal(config.ReplyMarkup) data, err := json.Marshal(config.ReplyMarkup)
if err != nil { if err != nil {