Add ParseMode to PhotoConfig
parent
212b154115
commit
60668682f7
|
@ -243,7 +243,8 @@ func (config ForwardConfig) method() string {
|
||||||
// PhotoConfig contains information about a SendPhoto request.
|
// PhotoConfig contains information about a SendPhoto request.
|
||||||
type PhotoConfig struct {
|
type PhotoConfig struct {
|
||||||
BaseFile
|
BaseFile
|
||||||
Caption string
|
Caption string
|
||||||
|
ParseMode string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Params returns a map[string]string representation of PhotoConfig.
|
// Params returns a map[string]string representation of PhotoConfig.
|
||||||
|
@ -253,6 +254,9 @@ func (config PhotoConfig) params() (map[string]string, error) {
|
||||||
if config.Caption != "" {
|
if config.Caption != "" {
|
||||||
params["caption"] = config.Caption
|
params["caption"] = config.Caption
|
||||||
}
|
}
|
||||||
|
if config.ParseMode != "" {
|
||||||
|
params["parse_mode"] = config.ParseMode
|
||||||
|
}
|
||||||
|
|
||||||
return params, nil
|
return params, nil
|
||||||
}
|
}
|
||||||
|
@ -268,6 +272,9 @@ func (config PhotoConfig) values() (url.Values, error) {
|
||||||
if config.Caption != "" {
|
if config.Caption != "" {
|
||||||
v.Add("caption", config.Caption)
|
v.Add("caption", config.Caption)
|
||||||
}
|
}
|
||||||
|
if config.ParseMode != "" {
|
||||||
|
v.Add("parse_mode", config.ParseMode)
|
||||||
|
}
|
||||||
return v, nil
|
return v, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue