Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic on bot.Stop() v4.0.0-beta.4 #760

Open
ofstudio opened this issue Nov 25, 2024 · 0 comments
Open

Panic on bot.Stop() v4.0.0-beta.4 #760

ofstudio opened this issue Nov 25, 2024 · 0 comments

Comments

@ofstudio
Copy link

panic: close of closed channel
goroutine 44 [running]:
gopkg.in/telebot%2ev4.(*Webhook).waitForStop(...)
	gopkg.in/telebot.v4@v4.0.0-beta.4/webhook.go:161
gopkg.in/telebot%2ev4.(*Webhook).Poll.func1(0xc000450a10)
	gopkg.in/telebot.v4@v4.0.0-beta.4/webhook.go:148 +0x2f
created by gopkg.in/telebot%2ev4.(*Webhook).Poll in goroutine 40
	gopkg.in/telebot.v4@v4.0.0-beta.4/webhook.go:147 +0x18a

the code

go bot.Start() // 1. Start the bot
<-ctx.Done()   // 2. Wait for context cancel on SIGING or SIGTERM
bot.Stop()     // 3. Stop the bot
// ^^^^ Panic goes here!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant