Closed Piero24 closed 3 years ago
Try this function with this parameters (you can adjust them later at your taste):
bot.infinity_polling(timeout=10, long_polling_timeout = 5)
Hi @Badiboy , Thanks for your reply. It works but with a slight problem. Sometimes when I send him a message he does not receive the reply and if I send it back to him immediately afterwards he replies.
I assume it's polling
being stopped and invoked with a new socket. (Correct me if I'm wrong).
Is there a way to fix this issue?
Now you can go here: https://github.com/eternnoir/pyTelegramBotAPI/issues/1211
I cannot reproduce this behaviour. We stopped on my request for debug information, but got no answer.
Please answer these questions before submitting your issue. Thanks!
Version pyTelegramAPI: 3.8.2
OS version: MacOS Big Sur 11.5.1 RaspBianOS ID = 10
Python version: python 3,7 - python 3.8 - python 3.9
When I leave my program running for a few hours and then send a message to the bot it doesn't reply and after a while it generates the following error.
From what I understand the problem lies in the requests made by bot.polling ().
I also tried with the example file echo_bot.py but the problem is the same. I tried different solutions:
Unfortunately all with the same problem. At first it works correctly and then after a few hours it stops responding.
This is sample code