Closed MatteZ02 closed 3 years ago
Can you try getting a stacktrace in the statusUpdate
event?
Something like new Error().stack
should do the trick.
Will do. Might take up to a few days for me to catch the error again.
Alright got the stack trace after 2 hours of continuous listening (on the same connection)
Can you share your Player.js file?
the uncompiled ts file of the player is 930 lines. I can send the entire thing if needed but is there any part you'd like to see in particular?
Alright got the stack trace after 2 hours of continuous listening (on the same connection)
Unfortunately i didn't take a proper look at the chain of errors that occurred around this stack.
Anyhow i just ran into a different one. Seems like the ws shard closed which resulted in the voiceConnection being destroyed by the adapter.
Don't mind the different line numbers. This is a wip bot and the code is continuously changing (which at times makes debugging a mess)
after 5 hours of debugging last night i got the error again. This time with debugging enabled for my djs client. so what happened was that the ws reconnected which caused the adapter to destroy the voiceConnection.
Alright i got it. So the reason the voiceConnection is destroyed is due to the adapter function cleanupGuilds
which will delete the existing voiceConnections. Just by commenting out adapters.get(guildID)?.destroy();
the problem went away.
This is odd, the intended behaviour of the adapter provided by discord.js is to only destroy once the main WebSocket shard has disconnected and will not attempt to reconnect.
I will take a look at fixing this adapter.
Please describe the problem you are having in as much detail as possible: VoiceConnection changes state to
destroyed
fromready
in the middle of playback. Sometimes this occurs after 10 minutes of listening, Sometimes after hours. Yet to find a proper way of reproducing this issue.Include a reproducible code sample here, if possible:
Further details:
Relevant client options: