How to get access to player from different file
So I'm making a music bot and I wanted to have a slash command that makes the bot skip to the next song, but I'm having problems with getting access to the player object created in another file, what can I do?
My two slash commands where one is the function that searches for a song and then plays it and the other one is to skip are in the same directory and I tried foing this:
By doing this if I try to log the player in skip.js this will print undefined.
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 OPthank you