client dereference error
After I've constructed the index code like this, I try to load it from a slashcommand file in the commands folder, but I get a circular reference error. What can I do to fix this?
3 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 staffYou shouldn't be exporting your client at all for this very reason. What are you doing in that command file that requires you to have the client? You should ideally just be using
interaction.client
I want to set the embed title to client.user.username in a command that outputs information about the bot. Would using interaction.client work?
Resolved, thank you!