Bot disconnects from vc after a few days on external host

My bot disconnects from a voice channel after a few days (no specific number). At the same time, the bot's presence gets removed. I'm not sure whether it had something to do with Discord.js or with the hosting service, so I'm asking the question here first.
2 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
SirNuny
SirNunyOP2y ago
This is the code
client.on('ready', async () => {
console.log(`${client.user.tag} started`);

client.user.setActivity('/help', { type: Discord.ActivityType.Playing });
music(client);
});
client.on('ready', async () => {
console.log(`${client.user.tag} started`);

client.user.setActivity('/help', { type: Discord.ActivityType.Playing });
music(client);
});
In the music function, the player and connection are created and the bot should join the vc and start playing music. Oh sorry, I thought you just meant I should make sure it's in the ready function. I'll try that
Want results from more Discord servers?
Add your server