Skip to content

Commit

Permalink
Fix ListenForWebhook closing chan after request.
Browse files Browse the repository at this point in the history
  • Loading branch information
Syfaro committed Dec 8, 2021
1 parent 3f07c5f commit fde58e5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit fde58e5

Please sign in to comment.