Bot won't join Voice Channel

I use the command, and it gets stuck trying to join the voice channel.
message.channel.send(`Playing ${args[1]}`);

var connection = joinVoiceChannel({
guildID: message.guild.id,
channelID: message.member.voice.channel.id,
adapterCreator: message.guild.voiceAdapterCreator
})

connection.on(VoiceConnectionStatus.Ready, () => {
console.log("Voice connection ready");
const player = createAudioPlayer();
connection.subscribe(player);

const audio = createAudioResource('./music.mp3');
player.play(audio);
})
message.channel.send(`Playing ${args[1]}`);

var connection = joinVoiceChannel({
guildID: message.guild.id,
channelID: message.member.voice.channel.id,
adapterCreator: message.guild.voiceAdapterCreator
})

connection.on(VoiceConnectionStatus.Ready, () => {
console.log("Voice connection ready");
const player = createAudioPlayer();
connection.subscribe(player);

const audio = createAudioResource('./music.mp3');
player.play(audio);
})
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.
MrDiamond
MrDiamondOP3y ago
1: -- [email protected] 2: No error 3: Look 4: Bot won't join vc. That's it 5: It is
Want results from more Discord servers?
Add your server