depoio / node-telegram-bot

Client wrapper for Telegram Bot API (Under heavy development)
MIT License
136 stars 30 forks source link

Fix for properly timeout every 60 seconds #58

Closed sebastianarena closed 8 years ago

sebastianarena commented 8 years ago

I've been dealing with tons of 409 errors. Which I still don't know where they came from. In the meantime I did find that these errors lead to some other unwanted problems which I believe I fix with this code. Feel free to ask any questions about it!

shernshiou commented 8 years ago

Thanks. However I have added another options to set timeout.

sebastianarena commented 8 years ago

Yes, the option for setting timeout doesn't really help. An easy way to test this problem is to open to instances of the bot and see how both of them start to go through the "stopped polling" if-branch and then spiral out of control. With this fix they should still throw the error, but don't span infinite callbacks.