all repos — telegram-bot-api @ d1358d12aaa4207728e8a60aa1c62b670611f9c3

Golang bindings for the Telegram Bot API

Update webhook.go

Why there is a hardcoded `bot.Token`? =)
Sergey Kamardin gobwas@gmail.com
Sun, 13 Sep 2015 21:56:43 +0300
commit

d1358d12aaa4207728e8a60aa1c62b670611f9c3

parent

236ac39b3448e02c9181a878928b592f53fe7191

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M webhook.gowebhook.go

@@ -9,10 +9,10 @@

// ListenForWebhook registers a http handler for a webhook. // Useful for Google App Engine or other places where you cannot // use a normal update chan. -func (bot *BotAPI) ListenForWebhook() { +func (bot *BotAPI) ListenForWebhook(config WebhookConfig) { 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) var update Update