Merge pull request #70 from Jeiwan/fix_voiceconfig_caption

Fix Caption in VoiceConfig
bot-api-6.1
Syfaro 2017-04-19 15:38:50 -05:00 committed by GitHub
commit ff42d6f7d1
1 changed files with 6 additions and 0 deletions

View File

@ -482,6 +482,9 @@ func (config VoiceConfig) values() (url.Values, error) {
if config.Duration != 0 { if config.Duration != 0 {
v.Add("duration", strconv.Itoa(config.Duration)) v.Add("duration", strconv.Itoa(config.Duration))
} }
if config.Caption != "" {
v.Add("caption", config.Caption)
}
return v, nil return v, nil
} }
@ -493,6 +496,9 @@ func (config VoiceConfig) params() (map[string]string, error) {
if config.Duration != 0 { if config.Duration != 0 {
params["duration"] = strconv.Itoa(config.Duration) params["duration"] = strconv.Itoa(config.Duration)
} }
if config.Caption != "" {
params["caption"] = config.Caption
}
return params, nil return params, nil
} }