parent
236ac39b34
commit
d1358d12aa
|
@ -9,10 +9,10 @@ import (
|
||||||
// ListenForWebhook registers a http handler for a webhook.
|
// ListenForWebhook registers a http handler for a webhook.
|
||||||
// Useful for Google App Engine or other places where you cannot
|
// Useful for Google App Engine or other places where you cannot
|
||||||
// use a normal update chan.
|
// use a normal update chan.
|
||||||
func (bot *BotAPI) ListenForWebhook() {
|
func (bot *BotAPI) ListenForWebhook(config WebhookConfig) {
|
||||||
bot.Updates = make(chan Update, 100)
|
bot.Updates = make(chan Update, 100)
|
||||||
|
|
||||||
http.HandleFunc("/"+bot.Token, func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/"+config.Url.Path, func(w http.ResponseWriter, r *http.Request) {
|
||||||
bytes, _ := ioutil.ReadAll(r.Body)
|
bytes, _ := ioutil.ReadAll(r.Body)
|
||||||
|
|
||||||
var update Update
|
var update Update
|
||||||
|
|
Loading…
Reference in New Issue