all repos — telegram-bot-api @ 8249dd6a932861ac1213dc4bcf4b6fc96104aa53

Golang bindings for the Telegram Bot API

Few bug fixes
Raul Santos raulsntos@gmail.com
Mon, 27 Jul 2015 00:22:10 +0200
commit

8249dd6a932861ac1213dc4bcf4b6fc96104aa53

parent

612584dbd3293113d88ed1212d8c8dd87a9b344a

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

jump to
M bot.gobot.go

@@ -14,14 +14,14 @@ }

// 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()
M methods.gomethods.go

@@ -190,7 +190,7 @@ }

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 }