Won't play please help
const { joinVoiceChannel } = require('@discordjs/voice');
let channel = '1107089389345067008';
joinVoiceChannel({
channelId: channel,
guildId: interaction.guild.id,
adapterCreator: interaction.guild.voiceAdapterCreator,
})
const { createReadStream } = require('node:fs');
const { join } = require('node:path');
const { createAudioResource, StreamType, createAudioPlayer } = require('@discordjs/voice');
// Basic, default options are:
// Input type is unknown, so will use FFmpeg to convert to Opus under-the-hood
// Inline volume is opt-in to improve performance
const player = createAudioPlayer();
// An AudioPlayer will always emit an "error" event with a .resource property
player.on('error', error => {
console.error('Error:', error.message, 'with track', error.resource.metadata.title);
});
const resource = createAudioResource('../../../playlist/Josh_Rubin_Surrender_NCS_Release.mp3', {
metadata: {
title: 'A good song!',
},
});
player.play(resource);
const { joinVoiceChannel } = require('@discordjs/voice');
let channel = '1107089389345067008';
joinVoiceChannel({
channelId: channel,
guildId: interaction.guild.id,
adapterCreator: interaction.guild.voiceAdapterCreator,
})
const { createReadStream } = require('node:fs');
const { join } = require('node:path');
const { createAudioResource, StreamType, createAudioPlayer } = require('@discordjs/voice');
// Basic, default options are:
// Input type is unknown, so will use FFmpeg to convert to Opus under-the-hood
// Inline volume is opt-in to improve performance
const player = createAudioPlayer();
// An AudioPlayer will always emit an "error" event with a .resource property
player.on('error', error => {
console.error('Error:', error.message, 'with track', error.resource.metadata.title);
});
const resource = createAudioResource('../../../playlist/Josh_Rubin_Surrender_NCS_Release.mp3', {
metadata: {
title: 'A good song!',
},
});
player.play(resource);
1 Reply
• 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.