go-telegram / bot

Telegram Bot API Go framework
MIT License
507 stars 46 forks source link

Don't know which bot is calling the error handler #39

Closed HeaPengVeng closed 10 months ago

HeaPengVeng commented 10 months ago

I have multiple bots running on go routine. I want handle this error: Starting Bot Failed: error get updates, unexpected response statusCode 409 for method getUpdates, {"ok":false,"error_code":409,"description":"Conflict: terminated by other getUpdates request; make sure that only one bot instance is running"}

which cause by when you run multiple bot instance. I want it to close the instance when that error happen. But it's seems like the error handler function doesn't pass in any value that I can konw which bot is causing the error so I can stop the instance (Because I'm runing multiple bots with go routine).

I'm thinking maybe you should pass in the bot instance into the error handler function.

sorry for my bad english

dedetia commented 1 month ago

did you get a solution to the error? I experienced the same case. @HeaPengVeng