Bot joins audio channel, turns green, still no sound
There is no error thrown, I don't see anything wrong. Mostly copied the guide.
client.channels.fetch(TESTCHANNEL).then(vc => {
const voiceChannelConnection = joinVoiceChannel({
channelId: TESTCHANNEL,
guildId: vc.guild.id,
adapterCreator: vc.guild.voiceAdapterCreator,
});
const musicPlayer = createAudioPlayer();
musicPlayer.on('error', error => {
console.error(`Error with audio player: ${error.message} with resource ${error.resource.metadata.title}`);
});
var currentlyPlaying = createAudioResource(path.join(__dirname,'music/defenders-of-oasis-village.mp3'));
//var currentlyPlaying = createAudioResource('music/defenders-of-oasis-village.mp3');
//currentlyPlaying.volume.setVolume(1);
musicPlayer.play(currentlyPlaying);
voiceChannelConnection.subscribe(musicPlayer);
console.log('playing?')
currentlyPlaying.playStream.on('error', error => {
console.error('Error:', error.message, 'with track', resource.metadata.title);
});
}) client.channels.fetch(TESTCHANNEL).then(vc => {
const voiceChannelConnection = joinVoiceChannel({
channelId: TESTCHANNEL,
guildId: vc.guild.id,
adapterCreator: vc.guild.voiceAdapterCreator,
});
const musicPlayer = createAudioPlayer();
musicPlayer.on('error', error => {
console.error(`Error with audio player: ${error.message} with resource ${error.resource.metadata.title}`);
});
var currentlyPlaying = createAudioResource(path.join(__dirname,'music/defenders-of-oasis-village.mp3'));
//var currentlyPlaying = createAudioResource('music/defenders-of-oasis-village.mp3');
//currentlyPlaying.volume.setVolume(1);
musicPlayer.play(currentlyPlaying);
voiceChannelConnection.subscribe(musicPlayer);
console.log('playing?')
currentlyPlaying.playStream.on('error', error => {
console.error('Error:', error.message, 'with track', resource.metadata.title);
});
})
