Slinky - Hello, I just started using the framework...

Hello, I just started using the framework yesterday and currently having a issue trying to reset the cooldown for a user if their command errored. I saw a previous message about using this.container.stores.get('preconditions').get('Cooldown').buckets.get('command').set(userId, 0); but buckets no longer seems accessible, if someone could point me in the right direction, that'd be fantastic. Thanks. 🙂
3 Replies
Favna
Favna•3y ago
buckets is a WeakMap which means the keys have to be objects. Haven't checked the code but I assume the keys are the whole command objects rather than just the name.
Favna
Favna•3y ago
WeakMap - JavaScript | MDN
A WeakMap is a collection of key/value pairs whose keys must be objects, with values of any arbitrary JavaScript type, and which does not create strong references to its keys. That is, an object's presence as a key in a WeakMap does not prevent the object from being garbage collected. Once an object used as a key has been collected, its correspo...
Slinky
SlinkyOP•3y ago
Thank you 😄
Want results from more Discord servers?
Add your server