Merge pull request #179 from CssHammer/master

Add ParseMode to PhotoConfig
bot-api-6.1
Syfaro 2018-06-02 03:01:29 -05:00 committed by GitHub
commit 4c16a90966
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

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