Extending Client and making Interaction.client use that new Client
As said in the guide, I have extended my Client class, no problems there. Though, I want to use
interaction.client
in my commands, yet that still refers to the old class. Forgive me, I'm a little new to JS and absolutely not sure how to go about this, am I thinking of it wrong even? Should I be passing client in my command handler? Should I just use imports? I would really like to avoid the imports, but I'm not against it. What is the right choice here, I'm almost positive I cannot be the first to ask this question, but a search yields no results here.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 OPHold on, stupid discord index in these forums did not show a forum down like 8 posts...
Honestly that was not helpful. Still need some help.
This is how I extended client.
For future people:
I'm going with the route of passing client to my commands in the handler, so instead of
I can do