Everything works fine in the below code as intended. Bot Joins Voice Channel and displays the name of song that is going to get played. Bot also starts playing song as I can see green circle around it but I cannot hear anything. Please help on how to fix it. Here is the given code:
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildVoiceStates] });
const { DisTube } = require('distube');
client.distube = new DisTube(client, {
leaveOnStop: false,
emitNewSongOnly: true,
emitAddSongWhenCreatingQueue: false,
emitAddListWhenCreatingQueue: false,
})
client.on('messageCreate', (message) => {
if(message.author.bot) return;
if(message.content === "joinvc"){
client.distube.play(message.member.voice.channel, "Die Hard" , {
member: message.member,
textChannel: message.channel,
message
})
}
})
client.distube.on("playSong", (queue, song) => {
queue.textChannel.send("NOW PLAYING : " + song.name)
})
client.login(' ')