Bot doesn't stop playing if I try to change what it's playing
I use a slash command to obtain a keyword to search on youtube and it works, but if I try to use the command a second time it downloads the new audio but does not change to playing it immediatly, instead it continues playing the old track for around 10-20 seconds and then starts playing the new song.
Code:
4 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 OPIn the discrod chat, the second time I use the command, it responds with not found, and In the console it doesn't log the "subscription cancelled" message, so I thinkth problem might be in the "if already playing" if.
while the actual resource you're creating in this code doesn't appear to necessarily be from youtube, your project's name seems to indicate you intend to stream from youtube at some point
this is your reminder that streaming from youtube to discord is explicitly against youtube's tos and by extension, discord's tos
we do not support tos violations
I'm trying to make it play a track that I download, it could be downloaded from youtubeb or another platform, but the problem is that It doesn't start playing the new downloaded track once I use the command and instead it waits for about 20 seconds