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. 🙂
F
Favna•535d 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.
F
Favna•535d 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...
S
Slinky•535d ago
Thank you 😄
Want results from more Discord servers?
Add your server
More Posts
Hyperfire - How would i ago about adding custom fi...How would i ago about adding custom fields to commands? Like for example aliasespochiko - Hello! does anyone kno whow to fix this ...Hello! does anyone kno whow to fix this problem? ive been trying to figure out why for the past 30 mNitsua - Editing a previously ran slash command re...Editing a previously ran slash command results in an error. ``` Encountered error on chat input comwilluhmjs - ```jsValidationError s.string Exp...```js ValidationError > s.string Expected a string primitive Received: | undefined at Stsam - ```srcconfig.ts737 - error TS2345 Argum...``` src/config.ts:7:37 - error TS2345: Argument of type 'string' is not assignable to parameter of tRhys - ^Sort of related to above, does inheritance...^Sort of related to above, does inheritance work with commands? I've got a few commands for openinThatGuyJamal - Is it possible to make a default va...Is it possible to make a default value for registering command meta data. Like: ``` guildIds: isCanaUser - ```javascriptconst { Client, Events, Gate...```javascript const { Client, Events, GatewayIntentBits } = require('discord.js'); const client Ben855 - For autocomplete arguments in slash comma...For autocomplete arguments in slash commands, if the user enters something that wasn't available in Rhys - Is there a way to use preconditions to remo...Is there a way to use preconditions to remove redundant if checks? For example: ```typescript @AppTobyy - how do i fixhow do i fixTobyy -