bot lost conection
OcatrapseSmith opened this issue · 3 comments
Hello,
Is there a way to check when the bot conection with telegram servers were lost?
Problem: When the host change its public IP, de lua-telegram-bot keep running but doesn't response any request. It is necesary kill it and re-run it to establish the conection. (I'm using run() facility)
Thx.
@OcatrapseSmith lua-telegram-bot does not hold an active connection to the Telegram servers. Rather, it connects with every request that is made by the bot. So no, it's not possible to know beforehand, wether the server is going to respond with a valid response or an error.
I agree though, that the error handling could be somewhat better.
If you come up with a good solution, feel free to create a Pull Request.
Hi.
I've been doing more tests and I think what happens is that the telegram server can not contact to the bot when the telegram client is asked to do so. I do not really how the API works, but the symptom is: If fter configure and initialize the bot calling local function configure (token), the host IP changes, the bot stops receiving requests.
I'm going to try some changes in the code in order to suggest something to you. This wrapper are very good documented.
Thanks.