Property 'cmds' does not exist on type 'Client<boolean>'
It's my first time using TypeScript with discord.js & express, I used some of my JS knowledge and it is causing an error now. (if it isnt fixable then what would be the best way to approach slash command handlers on TypeScript)
npm v.9.6.7
node v.18.3.0
discord.js v14.11.0
7 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!wrong one
We highly recommend you extend the
Client
structure properly instead of just attaching custom properties like .commands
to the regular discord.js Client
instance.
- Using typescript, you might want to consider casting or augmenting the module typeYou can probably just make your own interface that extends the discord.js Client.
ts
TypeScript Tutorial
TypeScript Extend Interface
in this tutorial, you will learn how to extend an interface that allows you to copy properties and methods of one interface to another.
I can give you the straight up solution as well if you want to.
Ohh, someon answered already, my bad