all repos — telegram-bot-api @ 1b2d9a5c42d5e37b9a38181fd5f273c6bda528d8

Golang bindings for the Telegram Bot API

Merge pull request #3 from sirlori/master

Little bugfix
Syfaro syfaro@foxpaw.in
Mon, 06 Jul 2015 15:07:02 -0500
commit

1b2d9a5c42d5e37b9a38181fd5f273c6bda528d8

parent

b68832daa682e4e5fa44007f5bfae6d38d942dfe

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

jump to
M methods.gomethods.go

@@ -132,9 +132,10 @@ // MakeRequest makes a request to a specific endpoint with our token.

// All requests are POSTs because Telegram doesn't care, and it's easier. func (bot *BotAPI) MakeRequest(endpoint string, params url.Values) (APIResponse, error) { resp, err := http.PostForm("https://api.telegram.org/bot"+bot.Token+"/"+endpoint, params) - defer resp.Body.Close() if err != nil { return APIResponse{}, err + } else { + defer resp.Body.Close() } bytes, err := ioutil.ReadAll(resp.Body)