all repos — telegram-bot-api @ cbf597eaf6f657b48e0192ccf6f43b08956456be

Golang bindings for the Telegram Bot API

add error try catch in the configs MessageConfig values method
LeeMyeongJun LeeMyeongJun
Wed, 30 Nov 2016 21:41:10 +0900
commit

cbf597eaf6f657b48e0192ccf6f43b08956456be

parent

0a57807db79efce7f6719fbb2c0e0f83fda79aec

1 files changed, 5 insertions(+), 1 deletions(-)

jump to
M configs.goconfigs.go

@@ -198,7 +198,11 @@ }

// values returns a url.Values representation of MessageConfig. func (config MessageConfig) values() (url.Values, error) { - v, _ := config.BaseChat.values() + v, err := config.BaseChat.values() + if err != nil { + data := url.Values{} + return data, err + } v.Add("text", config.Text) v.Add("disable_web_page_preview", strconv.FormatBool(config.DisableWebPagePreview)) if config.ParseMode != "" {