On start playing audio event
Hello here is my code:
but the
playing
audio event, Logs this messages twice and when the second logging was sent into the console the bot start playing the audio2 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!And i use the version
0.16.1
with node.js v21
No I was joined the voice channel and then i used this command
But when i added player.play(resource)
and connection.subsrcibe(player)
to the VoiceConnectionStatusReady
event in the connection.on()
, actually the start playing audio
event send a log once and exactly works for me
Like this code:
What I meant by sending the log twice was that the first time it was actually doing it before the audio was played, but the second time it was exactly at the same time as the playing audio.
And also the code above caused that first unrelated log to not be sent anymore
But I can't understand why this way solved the problem and also are there any better ways?