How to get the audioResource
I want to get the audioReasource to delete it, and i'm doing like this when it finish
but how can i get it if for example i want to use stop cmd
Also, is it possible to get it from here
player.on(AudioPlayerStatus.Idle, () => {})
10 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 OPThe code above showing how would i delete it when someone run play command for example,
the resources will be there and i can access it.
I’m asking about how can i reach it from different places, for example another command for stopping the audio
Sorry for late responding
you can attach the audioplayer to a discord.js structure like guild or your client, then get it from there and call pause on it. You need to be careful on how to keep track of the audio players and where do they belong though
the way i personally did it was attaching the audio player to the guild
I know how to access the audio player and voice connection,
I want to know how can i access the audio resources
@ShompiFlen @qjuh
i want to delete the stream
idk how to explain it, but i think
resource.playStream.destroy()
will remove the stream from the ram or something like this
wdym by references, like this?
const resource = createAudioResource(playObj.path);
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
great, anything that i can do along with
connection.destroy()
to have better performance?
i really don't know about voices, i use:
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•15mo ago
Message Not Public
Sign In & Join Server To View
mp3 file
thx for your help