Bot joins vc but doesnt play nything

import * as voice from '@discordjs/voice';
const player = voice.createAudioPlayer();
const resource = voice.createAudioResource('https://cdn.discordapp.com/attachments/810738582443917322/1010577980826849300/speech.mp3');

const connection = voice.joinVoiceChannel({
channelId: interaction.member.voice.channel.id,
guildId: interaction.guild.id,
adapterCreator: interaction.guild.voiceAdapterCreator
});

player.play(resource)
connection.subscribe(player);

player.on(voice.AudioPlayerStatus.Idle, () => {
connection.destroy()
})
import * as voice from '@discordjs/voice';
const player = voice.createAudioPlayer();
const resource = voice.createAudioResource('https://cdn.discordapp.com/attachments/810738582443917322/1010577980826849300/speech.mp3');

const connection = voice.joinVoiceChannel({
channelId: interaction.member.voice.channel.id,
guildId: interaction.guild.id,
adapterCreator: interaction.guild.voiceAdapterCreator
});

player.play(resource)
connection.subscribe(player);

player.on(voice.AudioPlayerStatus.Idle, () => {
connection.destroy()
})
no error
2 Replies
d.js docs
d.js docs2y 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.
steven
steven2y ago
discord.js@13.10.2 @discordjs/voice@0.11.0 bruh im so dumb needed GUILD_VOICE_STATES intent