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
d.js toolkit
d.js toolkit2y ago
• 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.
d.js docs
d.js docs2y ago
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 type
XurxoMF
XurxoMFOP2y ago
Hmmm, I'll try it ^^ Ok, I implemented a new class extending Client and all fine Thx a lot <a:av_besitos:1114871486419832852>
Want results from more Discord servers?
Add your server