From 2483f043976a025de9c97f53dfcaa4894c090b8b Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Tue, 28 Jul 2015 13:00:31 +0200 Subject: [PATCH] Separate NewBotAPI from NewBotAPIwithClient --- bot.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bot.go b/bot.go index 3d8bf94..74c867b 100644 --- a/bot.go +++ b/bot.go @@ -14,7 +14,13 @@ 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) (*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{} }