Discordjs/voice
First time working with it,
I have a cron job running eery 5 minutes. In the callback, the bot fetches an array and loops over it. Each array has a mp3 and a channel id. Now i want to run each mp3 in its own channel.
Scenario:Bot runs the join function, a connection is created. It then listens to ready event and create a player to run audio on the connection.
Issue: when bot loops on first element, it instead of waiting for connection to be established (ready) and running the audio, just attaches the listener, then goes to next item. For next item, it again runs the join function which overrieds the previous connection according to docs.
So how would i make bot wait for connection to be ready, wait for audio to be played, since i cant even await the connection.subscribe ):
Code:
2 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 OP#djs-voice