Fix ListenForWebhook closing chan after request.

bot-api-6.1
Syfaro 2021-12-07 21:30:04 -05:00
parent 3f07c5f676
commit fde58e56ae
1 changed files with 1 additions and 2 deletions

3
bot.go
View File

@ -484,13 +484,12 @@ func (bot *BotAPI) ListenForWebhook(pattern string) UpdatesChannel {
}
ch <- *update
close(ch)
})
return ch
}
// ListenForWebhookRespReqFormat registers a http handler for a webhook.
// ListenForWebhookRespReqFormat registers a http handler for a single incoming webhook.
func (bot *BotAPI) ListenForWebhookRespReqFormat(w http.ResponseWriter, r *http.Request) UpdatesChannel {
ch := make(chan Update, bot.Buffer)