#How to make my bot reconnect automatically?
13 messages · Page 1 of 1 (latest)
Could you please add a listener to shardError and check if it emits something?
it's not what you want
if you handle error events and discord.js can resume the websocket, it will do so
you always needed to handle error events to not crash
You received a regular close code on your websocket here… do you use any proxy or other shenanigans?
The thing is also that discord changed some things about their gateway, we hear more issues with reconnecting like this lately, both for v13 and v14.
👆
You already implemented a shardError handler, so you did part of it…
What? No
catch errors where they happen to keep your bot from crashing. Then djs will reconnect if it can. If your bot crashes without any error/rejection then you either have an error handler that ignores errors instead of handling them or you the process ended regularly meaning the client got destroyed