all repos — telegram-bot-api @ 2fa77043adf21ec8e5cf0cc2d12d5e351471ed5c

Golang bindings for the Telegram Bot API

Merge pull request #538 from fbbdev/patch-1

Close hanging channel in ListenForWebhookRespReqFormat
Syfaro syfaro@huefox.com
Wed, 19 Oct 2022 20:31:55 -0400
commit

2fa77043adf21ec8e5cf0cc2d12d5e351471ed5c

parent

00ae0202053389c6ad3932d730e3f9fcdcace649

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

jump to
M bot.gobot.go

@@ -493,6 +493,8 @@ func (bot *BotAPI) ListenForWebhookRespReqFormat(w http.ResponseWriter, r *http.Request) UpdatesChannel {

ch := make(chan Update, bot.Buffer) func(w http.ResponseWriter, r *http.Request) { + defer close(ch) + update, err := bot.HandleUpdate(r) if err != nil { errMsg, _ := json.Marshal(map[string]string{"error": err.Error()})

@@ -503,7 +505,6 @@ return

} ch <- *update - close(ch) }(w, r) return ch