Separate NewBotAPI from NewBotAPIwithClient
Raul Santos raulsntos@gmail.com
Tue, 28 Jul 2015 13:00:31 +0200
1 files changed,
7 insertions(+),
1 deletions(-)
jump to
M
bot.go
→
bot.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{} }