all repos — telegram-bot-api @ 937de558bd97e1bd0c9800eb7082c227fe56d1e6

Golang bindings for the Telegram Bot API

Merge pull request #80 from polict/master

added 'caption' to document parameters
Syfaro syfaro@foxpaw.in
Wed, 19 Apr 2017 15:37:58 -0500
commit

937de558bd97e1bd0c9800eb7082c227fe56d1e6

parent

89bbb1edff353a7c6d10ef10cfd2675056ad8a58

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 }