1
0
telegram/get_webhook_info.go

18 lines
499 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.
2017-09-04 18:33:50 +00:00
func (bot *Bot) GetWebhookInfo() (*WebhookInfo, 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 {
return nil, err
}
var data WebhookInfo
err = json.Unmarshal(*resp.Result, &data)
return &data, err
}