commit
1b2d9a5c42
|
@ -132,9 +132,10 @@ type WebhookConfig struct {
|
||||||
// All requests are POSTs because Telegram doesn't care, and it's easier.
|
// All requests are POSTs because Telegram doesn't care, and it's easier.
|
||||||
func (bot *BotAPI) MakeRequest(endpoint string, params url.Values) (APIResponse, error) {
|
func (bot *BotAPI) MakeRequest(endpoint string, params url.Values) (APIResponse, error) {
|
||||||
resp, err := http.PostForm("https://api.telegram.org/bot"+bot.Token+"/"+endpoint, params)
|
resp, err := http.PostForm("https://api.telegram.org/bot"+bot.Token+"/"+endpoint, params)
|
||||||
defer resp.Body.Close()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return APIResponse{}, err
|
return APIResponse{}, err
|
||||||
|
} else {
|
||||||
|
defer resp.Body.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
bytes, err := ioutil.ReadAll(resp.Body)
|
bytes, err := ioutil.ReadAll(resp.Body)
|
||||||
|
|
Loading…
Reference in New Issue