Bot transitioning from playing to autopause
Hi I'm taking my first steps into coding a personal project for the first time, I decided to create a discord bot to play URL links of radio stations.
After reading a decent amount of the documentation and understanding the core logic of all the setting up and event handling/command creation I decided to try to get it to join a channel, which was successful, and now I'm trying to have it play a simple track.
Here's the situation: It joins the room, it transitions from buffering to playing, it registers the Playback as "started successfully" but then Audio player transitions from "playing" to "autopaused" and there is no audio.
Upon inspecting the bot, I see that it is in a constant audio disabled state. As can be seen in the screenshot attached.
What I have tried is to kick the bot and change all the permissions in the discord.com/developers/applications
giving it all the speak permissions and whatnot, I also set all the permissions within the server (It's just me and a friend in it with no other roles besides "everyone". And also set the permissions of the server and the audio room to make sure the bot as well as any other member to have all the permissions needed to use audio in the audio channel. With no success. I'm attaching the screenshot and below the entire code for the command in my github, everything else is perfectly set as if it wasn't the bot crash before running. There goes the code; Sorry if I'm messing something up here I'm reasonably new at this
https://github.com/danielmantilha/joinjs/blob/main/js
I really appreciate any insights.
GitHub
joinjs/js at main · danielmantilha/joinjs
Contribute to danielmantilha/joinjs development by creating an account on GitHub.


7 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by staff1. in future, #djs-voice is probably better for voice issues
2. I do see you have a few logs for state changes, does the voice connection ever actually become ready?
if not, do you have the
GuildVoiceStates
intent?hey @duck ! I appreciate the reply. I will move this if I can, I'm sorry its in the wrong.
this is what I'm outputting after running index.js
as for the GuildVoiceStates intent. No, I'm only passing in the entire GatewayIntentBits on index.js as such
doesn't look like the connection becomes ready
and that isn't actually where you're declaring your client's intents
that'd be in your
Client
constructor
you will need the GuildVoiceStates
intent to properly connect to the voice channelMy apologies. The Client instance is getting created as such
should I specify the GuildVoiceStates additionally to the intents I already have?
you will need the GuildVoiceStates
intent to properly connect to the voice channel
yesOk, thank you very much for your time. I will be trying that. Have a good night!
hoooly molly it works 🙂 you da man