#createAudioResource() - delete underlying file

4 messages · Page 1 of 1 (latest)

copper barn
#

When passing a file to the createAudioResource() once the function finishes can I delete the underlying file that the function was passed? Or do I need to wait until that underlying file is not being used anymore to then delete it?

kind escarpBOT
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

copper barn
#

node -v = 19.8.1

relevant code snippet

const audioResource = createAudioResource(filename)
player.play(audioResource)```

passed the location of a locally saved audio file to then be played via the `AudioPlayer`
#

Also using the latest discord.js and @discordjs/voice packages