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 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.
steven
stevenOP3y ago
[email protected] @discordjs/[email protected] bruh im so dumb needed GUILD_VOICE_STATES intent
Want results from more Discord servers?
Add your server