From 8249dd6a932861ac1213dc4bcf4b6fc96104aa53 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Mon, 27 Jul 2015 00:22:10 +0200 Subject: [PATCH] Few bug fixes --- bot.go | 4 ++-- methods.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bot.go b/bot.go index 6c2bfb4..e0fc732 100644 --- a/bot.go +++ b/bot.go @@ -14,14 +14,14 @@ type BotAPI struct { // NewBotAPI creates a new BotAPI instance. // Requires a token, provided by @BotFather on Telegram -func NewBotAPI(token string, client http.Client) (*BotAPI, error) { +func NewBotAPI(token string, client *http.Client) (*BotAPI, error) { if client == nil { client = &http.Client{} } bot := &BotAPI{ Token: token, - Client: client, + Client: *client, } self, err := bot.GetMe() diff --git a/methods.go b/methods.go index a3f6ccc..a1f6e2e 100644 --- a/methods.go +++ b/methods.go @@ -190,7 +190,7 @@ func (bot *BotAPI) UploadFile(endpoint string, params map[string]string, fieldna w.Close() - req, err := bot.Client.NewRequest("POST", "https://api.telegram.org/bot"+bot.Token+"/"+endpoint, &b) + req, err := http.NewRequest("POST", "https://api.telegram.org/bot"+bot.Token+"/"+endpoint, &b) if err != nil { return APIResponse{}, err }