Closed archimed-shaman closed 8 months ago
Hi @archimed-shaman, would you share how you get this far please? I'm having troubles making webhook work for tucnak/telebot. Moreover, webhook does not need poller, right?
The reason for this problem is If you do not configure the Listen field poll function will directly call the waitForStop method to close the channel
When you call the Stop function, this function will call waitForStop for the second time closing the channel to cause panic
https://github.com/tucnak/telebot/blob/71ac2995cc5d7379c35fceb3b64ce2c693e79e0c/webhook.go#L131-L133
Am I correct in understanding that for an elegant solution to the problem, we simply do not need to call the Stop() method when terminating the bot process? If I don't call this method, no panic occurs, but how necessary is its invocation and how much can the absence of calling the Stop() method when using WebHooks lead to negative consequences? I would be grateful if someone could help me understand this issue.
It was not actually fixed, If you call Stop
, you close the channel. And then, in waitForStop
you cancel it the next time...
I confirm this is not fixed.
Please, reopen (the stacktrace is identical to the OP's stacktrace).
gopkg.in/telebot.v3 v3.1.3
Error:
Looks like this happens because
stop
channel is closed in two places: https://github.com/tucnak/telebot/blob/fbd35f210343604adb89e96859a9639d9366e966/bot.go#L222 https://github.com/tucnak/telebot/blob/fbd35f210343604adb89e96859a9639d9366e966/webhook.go#L123