Client is now a pointer
parent
8249dd6a93
commit
fc8cb6e039
12
bot.go
12
bot.go
|
@ -5,11 +5,11 @@ import "net/http"
|
||||||
|
|
||||||
// BotAPI has methods for interacting with all of Telegram's Bot API endpoints.
|
// BotAPI has methods for interacting with all of Telegram's Bot API endpoints.
|
||||||
type BotAPI struct {
|
type BotAPI struct {
|
||||||
Token string `json:"token"`
|
Token string `json:"token"`
|
||||||
Debug bool `json:"debug"`
|
Debug bool `json:"debug"`
|
||||||
Self User `json:"-"`
|
Self User `json:"-"`
|
||||||
Updates chan Update `json:"-"`
|
Updates chan Update `json:"-"`
|
||||||
Client http.Client `json:"-"`
|
Client *http.Client `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBotAPI creates a new BotAPI instance.
|
// NewBotAPI creates a new BotAPI instance.
|
||||||
|
@ -21,7 +21,7 @@ func NewBotAPI(token string, client *http.Client) (*BotAPI, error) {
|
||||||
|
|
||||||
bot := &BotAPI{
|
bot := &BotAPI{
|
||||||
Token: token,
|
Token: token,
|
||||||
Client: *client,
|
Client: client,
|
||||||
}
|
}
|
||||||
|
|
||||||
self, err := bot.GetMe()
|
self, err := bot.GetMe()
|
||||||
|
|
Loading…
Reference in New Issue