Checking if a connection is already established.

Hey there, I was just wondering if I should be checking if the bot already has an established connection before running the below code:
joinVoiceChannel({
channelId: channelId,
guildId: interaction.guild.id,
adapterCreator: interaction.guild.voiceAdapterCreator,
selfDeaf: false
});
joinVoiceChannel({
channelId: channelId,
guildId: interaction.guild.id,
adapterCreator: interaction.guild.voiceAdapterCreator,
selfDeaf: false
});
I'm mainly curious to know if there is any performance issues by not checking first, or if adding checking would add performance issues. Just trying to optimize things with my bot :)
2 Replies
d.js docs
d.js docs3y 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.
dzlandis
dzlandisOP3y ago
DJS v14.3.0 and @discordjs/voice v0.11.0
Want results from more Discord servers?
Add your server