running multiple bots with one script

I tried running about 14 bots with one script and make them join voice channels and tried using worker threads to run each bot on a separate thread and distribute the bots and balance them on multiple cpu cores but but after a while of launching the script some of those bots go offline idk if the cpu can't handle running all of those bots simultaneously or it's just an internet problem can anyone help me understand the problem? Or at least suggest some methods to debug the problem
9 Replies
d.js toolkit
d.js toolkit4w ago
- What are your intents? GuildVoiceStates is required to receive voice data! - Show what dependencies you are using -- generateDependencyReport() is exported from @discordjs/voice. - Try looking at common examples: https://github.com/discordjs/voice-examples. - 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!
lupus
lupus4w ago
I mean, both could be an issue. Try monitoring CPU/Ram usage or reading system logs (especially if you're on Linux) to find out about potential OOM kills. It could also just be Discord killing some bots due to ratelimiting or abuse prevention.
Nassim
Nassim4w ago
I can use child processes to run each one in a separate node process but i don't think that would make any difference would it ? How would be to monitor cpu and ram usage on windows are there any designated tool i should use?
lupus
lupus4w ago
Uuh, Task Manager? I'm just using that on Windows, I haven't heard of any "special" other took for it.
Nassim
Nassim4w ago
Well i tried that the cpu and ram usage looks normal node doesn't exceed 17% of cpu and about 100 mb of ram
lupus
lupus4w ago
Alright, the process doesn't crash but the bots go offline, right?
Nassim
Nassim4w ago
Yeah or just leave the vc sometimes U used the index of each token as the group identifier in the joinVoiceChannel function
lupus
lupus4w ago
And you're sure your connection can handle that? You could try logging debug/warn events.
Nassim
Nassim4w ago
Wait lemme provide some screenshots Oky wait lemme try I thought of that it could be a connection issue
Want results from more Discord servers?
Add your server