How to test a bot that manages dozens of users in a voice channel?
I am working on a discord bot that manages dozens of active users in a servers voice channels. I can easily test with 2-3 users by logging in on several of my own devices, but I am worried that once I hit dozens of users I may run into some rate limiting issues or other bugs and I would love to find these before I start running in production.
The bot sets up an event then moves users around once the event starts, so it'd be pretty embarrassing if something breaks after people arrive for the event.
I tried to set up a bunch of bots and then log them in a loop, but there must be some limitation from Discord because it only lets me log in one bot at a time from my laptop.
Does anyone have any advice on how I can test this locally?
6 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!discord.js 14.18.0
node v20.18.1
I read somewhere there's a 60 second cooldown between client creations so I tried just logging in each bot 65 seconds apart, but that didn't work. It allows the first bot I have to log in but the 2nd just can't join
My backup plan is to spin up a bunch of really cheap servers on some cloud provider and log in one bot per server, but was wondering if there's an easier (and cheaper) solution
Pastebin
import { Client, GatewayIntentBits, ChannelType } from 'discord.js'...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
:propertysignature: JoinVoiceChannelOptions#group
voice@main
An optional group identifier for the voice connection.hmm okay, so maybe I can use the bot id as the group identifier. Will try that, thanks.
@Qjuh You are the GOAT!! Thank you
