jTelegramBotAPI icon indicating copy to clipboard operation
jTelegramBotAPI copied to clipboard

How to restart a listener

Open Polve opened this issue 4 years ago • 0 comments

I run a long-term bot that listen to telegram events and needs to react to them.

The problem is that sometimes (usually after some days/weeks of correct work), for some reason not clear that I suspect is due to intermittent network failures, the bot stops being able to communicate with telegram so I need to stop the application and restart it.

This is clearly not practical because I'm not able to know if and when the bot "disconnects" without doing a manual test, so my question is:

  • is it possible to detect that for some reason the the UpdateProvider stopped working correctly?
  • how may I disconnect it and force a reconnection? Do I need to de-register the bot and re-register it? If so, is it possible to de-register a bot? I was unable to find something like this in the API.

Polve avatar Oct 26 '21 09:10 Polve