all repos — telegram-bot-api @ 2e8be8df9fceb0faca1e2e177b98871a02b7d817

Golang bindings for the Telegram Bot API

Close hanging channel in ListenForWebhookRespReqFormat
Fabio Massaioli fbbdev@users.noreply.github.com
Sun, 24 Apr 2022 03:35:19 +0200
commit

2e8be8df9fceb0faca1e2e177b98871a02b7d817

parent

537c005643adee10686fa7d9bb860dec33a535d4

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

jump to
M bot.gobot.go

@@ -494,6 +494,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()})

@@ -504,7 +506,6 @@ return

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