all repos — telegram-bot-api @ 2483f043976a025de9c97f53dfcaa4894c090b8b

Golang bindings for the Telegram Bot API

Separate NewBotAPI from NewBotAPIwithClient
Raul Santos raulsntos@gmail.com
Tue, 28 Jul 2015 13:00:31 +0200
commit

2483f043976a025de9c97f53dfcaa4894c090b8b

parent

fc8cb6e0398c8801c799ebe0a09d26e87ae6f6ce

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

jump to
M bot.gobot.go

@@ -14,7 +14,13 @@ }

// 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) (*BotAPI, error) { + return NewBotAPIwithClient(token, nil) +} + +// NewBotAPI creates a new BotAPI instance passing an http.Client. +// Requires a token, provided by @BotFather on Telegram +func NewBotAPIwithClient(token string, client *http.Client) (*BotAPI, error) { if client == nil { client = &http.Client{} }