From 6b5102fab5586322d6fe98112fc671ad23dfae33 Mon Sep 17 00:00:00 2001 From: zhuharev Date: Tue, 31 Oct 2017 02:34:34 +0300 Subject: [PATCH] fix debug printing --- bot.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bot.go b/bot.go index 2a69a33..7d94a2c 100644 --- a/bot.go +++ b/bot.go @@ -73,8 +73,9 @@ func (bot *BotAPI) MakeRequest(endpoint string, params url.Values) (APIResponse, if err != nil { return apiResp, err } + if bot.Debug { - log.Printf("%s %s", endpoint, bytes) + log.Printf("%s resp: %s", endpoint, bytes) } if resp.StatusCode == http.StatusForbidden { @@ -110,7 +111,7 @@ func (bot *BotAPI) decodeAPIResponse(responseBody io.Reader, resp *APIResponse) return } - return + return data, nil } // makeMessageRequest makes a request to a method that returns a Message.