Methods
.call(limit: string, descriptors: string) → boolean
Return the result of the RateLimit#call
for the given
descriptors. See RateLimitManager#get
for details on
fetching RateLimits via descriptors
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
limit |
|
Ratelimit string matching the regex |
|
descriptors |
|
<repeatable> |
RateLimit target descriptors |
.get(limit: string, descriptors: string) → RateLimit
Get a RateLimit
object for the given target descriptors. This can be
any arbitrary set of strings representing whatever you want. A good example
would be a RateLimit for a User within a Guild with 5 uses per minute:
<RateLimitManager>.get('5/1m', guild.id, user.id);
Or if you wanted to limit something in a DM for the specific User to 10 uses per 5 minutes:
<RateLimitManager>.get('10/5m', user.id, 'DM');
The possibilities are endless.
Note: The limit string counts as part of the descriptor. As such
<RateLimitManager>.get('1/5m');
is a valid descriptor, but keep in mind that every time you retrieve it, it will be the same RateLimit instance, so if you need unique RateLimits for the same limit/duration, you must create a unique descriptor
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
limit |
|
Ratelimit string matching the regex |
|
descriptors |
|
<repeatable> |
RateLimit target descriptors |