Bot joins the vc but audio doesn't play

yes the path is correct.

var { voice } = message.member
        if(!voice.channelId) return message.reply({content:`This command requires you to join a vc in this server. [Get help](<https://discord.gg/steamhappy>)`})
           
        const connection = joinVoiceChannel({
            channelId: voice.channel.id,
            guildId: voice.channel.guild.id,
            adapterCreator: voice.channel.guild.voiceAdapterCreator,
        });

        if(!connection) return message.reply({content:`Couldn't connect to the voice channel. [Get help](<https://discord.gg/steamhappy>)`})

        message.reply({content:`Successfully joined ${voice.channel}`})

        const player = createAudioPlayer({
            behaviors: {
                noSubscriber: NoSubscriberBehavior.Pause,
            },
        });

        const resource = createAudioResource(path.join(__dirname + 'sounds/meow.mp3'));
        player.play(resource);

        connection.subscribe(player)
Was this page helpful?