Merge pull request #80 from polict/master added 'caption' to document parameters
Syfaro syfaro@foxpaw.in
Wed, 19 Apr 2017 15:37:58 -0500
1 files changed,
8 insertions(+),
0 deletions(-)
jump to
M
configs.go
→
configs.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 }