I've been investigating this issue concerning the anomalous reconnection of my bot's WS on an RFC Error Event Code 1001 and 1006 (only ones I've seen till now).
The main problem is that when these reconnections happen the bot, if it's in a VC, receives a voiceStateUpdate which has channel_id: null, this is of course interpreted as a MEMBER_MOVE event and it disconnects the bot from the VC.
Is there any way to catch the codes before hand and prevent the bot from disconnecting?
for reference:
Error Codes
1001 — CLOSE_GOING_AWAY — browser tab closing
1006 — CLOSE_ABNORMAL — no close code frame has been received
Logs
{"level":"info","message":"debug: [\n \"> devDebug\",\n \"debug\",\n \"[WS => Shard 0] [CLOSE]\\n Event Code: 1001\\n Clean : true\\n Reason : \"\n]","time":"[16:5:2022 - 23:35]"}
and
{"level":"info","message":"debug: [\n \"> devDebug\",\n \"debug\",\n \"[WS => Shard 0] [CLOSE]\\n Event Code: 1006\\n Clean : false\\n Reason : \"\n]","time":"[16:5:2022 - 23:14]"}
one a normal reconnect, in which the bot doesnt disconnect, the event code is 4000
Any insight and/or help is greatly appreciated, thanks in advance!
if any other information is needed, I'll see that it be provided if possible