not playing

const voiceChannel = interaction.member?.voice.channel;

    const connection = joinVoiceChannel({
      channelId: voiceChannel.id,
      guildId: interaction.guild.id,
      adapterCreator: interaction.guild.voiceAdapterCreator,
    });

    const player = createAudioPlayer();
    const resource = createAudioResource(
      path.join(__dirname, "./music/audio.mp3")
    );

    player.play(resource);
    connection.subscribe(player);

    player.on("error", (error) => {
      console.error(`Audio player error: ${error.message}`);
    });

the bot joins, no errors, yet no music playin
Was this page helpful?