Closed YetAnotherConnor closed 2 years ago
I also had this question, however on further inspection i think this is how it works.
joinVoiceChannel({
channelId: this.channel.id,
guildId: this.channel.guild.id,
group: this.channel.client.user.id,
adapterCreator: this.channel.guild.voiceAdapterCreator
});
Ill test this theory shortly!
Yep, the answer given here is correct!
Is your feature request related to a problem? Please describe. There does not appear to be any way to specify a Client when using
joinVoiceChannel
. For processes with more than one Client, it is uncontrollable which Client joins the voice channel. In my testing, a Client consistently joins with the same code ran; however a different Client could join instead after changing code, even seemingly unrelated code.Describe the ideal solution
Describe alternatives you've considered
joinVoiceChannel
using the guild object from the client's own cache, which had the same behavior as above.module.exports = class TestBot extends Client { constructor(config) { super({ intents: [Intents.FLAGS.GUILD_VOICE_STATES, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILDS], }); this.config = config; }
testBotJoinVoiceChannel(channelId, guildId) { const guild = this.guilds.cache.get(guildId); if (!guild) return null; let conn = joinVoiceChannel({ guildId, channelId, adapterCreator: guild.voiceAdapterCreator, }); return conn; } };