TypeScript client.cooldowns
Hihi. I have a bot in JavaScript working perfectly fine but I decide to change it to TypeScript(im totally new in ts but not in js).
The problem is then when I use
client.cooldowns = new Collection(...)
VSCode says that the porperty cooldowns does not exists in Client<boolean>.
The thing is, how can I add the property cooldowns to the client so ts recognizes it?
What I can do is parse client to any and problem solved, but I think is not the best option.3 Replies
• 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.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 typeHmmm, I'll try it ^^
Ok, I implemented a new class extending Client and all fine
Thx a lot <a:av_besitos:1114871486419832852>