added 'caption' to document parameters
parent
f5c6a478a0
commit
999653626b
|
@ -349,6 +349,7 @@ func (config AudioConfig) method() string {
|
||||||
// DocumentConfig contains information about a SendDocument request.
|
// DocumentConfig contains information about a SendDocument request.
|
||||||
type DocumentConfig struct {
|
type DocumentConfig struct {
|
||||||
BaseFile
|
BaseFile
|
||||||
|
Caption string
|
||||||
}
|
}
|
||||||
|
|
||||||
// values returns a url.Values representation of DocumentConfig.
|
// values returns a url.Values representation of DocumentConfig.
|
||||||
|
@ -359,6 +360,9 @@ func (config DocumentConfig) values() (url.Values, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
v.Add(config.name(), config.FileID)
|
v.Add(config.name(), config.FileID)
|
||||||
|
if config.Caption != "" {
|
||||||
|
v.Add("caption", config.Caption)
|
||||||
|
}
|
||||||
|
|
||||||
return v, nil
|
return v, nil
|
||||||
}
|
}
|
||||||
|
@ -367,6 +371,10 @@ func (config DocumentConfig) values() (url.Values, error) {
|
||||||
func (config DocumentConfig) params() (map[string]string, error) {
|
func (config DocumentConfig) params() (map[string]string, error) {
|
||||||
params, _ := config.BaseFile.params()
|
params, _ := config.BaseFile.params()
|
||||||
|
|
||||||
|
if config.Caption != "" {
|
||||||
|
params["caption"] = config.Caption
|
||||||
|
}
|
||||||
|
|
||||||
return params, nil
|
return params, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue