all repos — telegram-bot-api @ 999653626b7ed4aaaa20a17b51fe63caadfdffc2

Golang bindings for the Telegram Bot API

added 'caption' to document parameters
pol paolo.giai@icloud.com
Sat, 11 Feb 2017 15:13:49 +0100
commit

999653626b7ed4aaaa20a17b51fe63caadfdffc2

parent

f5c6a478a0e3271a51649c64661ac90ed3d30bf1

1 files changed, 8 insertions(+), 0 deletions(-)

jump to
M configs.goconfigs.go

@@ -349,6 +349,7 @@

// DocumentConfig contains information about a SendDocument request. type DocumentConfig struct { BaseFile + Caption string } // values returns a url.Values representation of DocumentConfig.

@@ -359,6 +360,9 @@ return v, err

} v.Add(config.name(), config.FileID) + if config.Caption != "" { + v.Add("caption", config.Caption) + } return v, nil }

@@ -366,6 +370,10 @@

// params returns a map[string]string representation of DocumentConfig. func (config DocumentConfig) params() (map[string]string, error) { params, _ := config.BaseFile.params() + + if config.Caption != "" { + params["caption"] = config.Caption + } return params, nil }