1
0
telegram/get_webhook_info.go

18 lines
490 B
Go
Raw Normal View History

2017-09-04 18:33:50 +00:00
package telegram
import json "github.com/pquerna/ffjson/ffjson"
2017-10-06 07:55:54 +00:00
// GetWebhookInfo get current webhook status. Requires no parameters. On success,
// returns a WebhookInfo object. If the bot is using getUpdates, will return an
// object with the url field empty.
2018-08-21 11:05:04 +00:00
func (bot *Bot) GetWebhookInfo() (info *WebhookInfo, err error) {
2018-04-12 11:58:05 +00:00
resp, err := bot.request(nil, MethodGetWebhookInfo)
2017-09-04 18:33:50 +00:00
if err != nil {
2018-08-21 11:05:04 +00:00
return
2017-09-04 18:33:50 +00:00
}
2018-08-21 11:05:04 +00:00
info = new(WebhookInfo)
err = json.Unmarshal(*resp.Result, info)
return
2017-09-04 18:33:50 +00:00
}