Maintaining connection after restarting node
I have a bot that would connect to a channel and play sounds. I have a slash command that would play one of the few sound files I have, it works fine but when I restart node it would stay in the channel but if I try doing anything it would say that the bot isn't in a voice channel and I would have to reconnect the bot to the voice channel. I get the connection using though it would still return undefined even if the bot is in the channel (This is if I restarted node when the bot was already in a voice channel) Is there a way to keep the connection even if you restart node, because I sometimes have problems when the bot is on multiple servers and I restart node. Here's the full code of the command execute function
3 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OP
Node is version v21.6.0
No, there's not
Unless you host it somewhere else
It's impossible, as TCP of the other side will detect the connection is dead