Cannot join voice channel

I am rewritting my bot from DJS v12 to v14. I started by writing a simple music bot that would play a youtube link using ytdl-core. But when it tries to join a voice channel it just doesn't and then it is unable to subscribe. I believe it may have something to do with the voice adapter but I am not sure how that works. Gateway intents are enabled, and I did manage to make it join using the discord-player package but that package is way beyond my understanding. Using Windows 10 Enterprise Node.js v18.13.0 ├── @discordjs/[email protected] ├── @discordjs/[email protected] ├── [email protected] ├── [email protected] └── [email protected]
12 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
</> Idris
</> Idris2y ago
<AudioPlayer>.subscribe() doesn’t exist
LolGamer
LolGamerOP2y ago
https://discordjs.guide/voice/voice-connections.html I was trying to follow this guide, do I need to create an audio player and the subscribe? Wouldn't ytdl be enough?
discord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
</> Idris
</> Idris2y ago
don’t even know what you trynna do
LolGamer
LolGamerOP2y ago
My bad, wrong url
</> Idris
</> Idris2y ago
ok but what’s your goal? there’s no player.subscribe() there
LolGamer
LolGamerOP2y ago
Right, So I am trying to make it join a Voice Channel, and then play music using ytdl core. The first problem is that the bot won't join the voice channel.
</> Idris
</> Idris2y ago
the guide correctly explains how to
LolGamer
LolGamerOP2y ago
As for the subscribe part, it seems to come from the bot not joining in the first place. I don't seem to be able to do so...
</> Idris
</> Idris2y ago
interaction.channelId is the voice channel id?
LolGamer
LolGamerOP2y ago
... no, just changed it and it works Thanks Idris, you're the real hero
</> Idris
</> Idris2y ago
gigachad

Did you find this page helpful?