[RFC] Supporting auto-reconnect to discord gateway
The bot has been terminating with InternalThread.ERROR: websocket error {"e":"Unable to read from stream: stream_get_contents(): SSL: Connection reset by peer"} [] appearing in the log. Is this a bug in the bot or just unstable network? If its network instability could the bot autoreconnect without having to restart the entire server?
I'm going to assume unstable network.
In terms of the auto-reconnect its a bit of a shady area as to what to do, there are indeed many options like auto reconnecting but that would create problems with what to do during that gap eg if a plugin tries sending a message or is waiting on one during that gap it would never work.
Welcome to other ways to support reconnecting but it requires a lot more thought and structure into the plugin before that can be done.