It is known now that chat bot still gets disconnected even when you properly response to PINGs with PONGs, Since TMI servers sometimes are being restarted on the twitch side. Disconnects tend to happen every 4-5 days.
What is the best and proper way for chat-bot to detect D/C?
- By sending PING to TMI and waiting for PONG? (Does TMI server answer to that?).
- Inactivity. But what if stream is offline and nothing happens in chat? This would raise unwanted bot restarts and creates empty windows when bot can not response.
- socket.io detect disconnect?
- Make timer() and restart every 24 hour? But do I need to do that that often if bot sometimes may work fine for 3+ days? What if bot gets D/C in few hours, he may be unavailable for half a day.
p.s: and how do I properly restart socket.io connection? I use Python