RateLimit

Maintains its own call count and expiry for making sure things only happen a certain number of times within a given timeframe

Constructor

new RateLimit(limit: Tuple<number, number>)

Parameters:
Name Type Description
limit
Tuple<number, number>

Tuple containing limit and duration

Source:

Properties

.duration: number

The time from first call until reset

Type:
number
Source:

.isLimited: boolean

Return whether or not this ratelimit is currently capped out for the current expiry period

Type:
boolean
Source:

.limit: number

The number of times this RateLimit can be called within its expiry period

Type:
number
Source:

.remaining: number

The remaining number of uses this RateLimit has for this expiry period

Type:
number
Source:

.wasNotified: boolean

Whether or not this RateLimit was flagged for having had a notification given for being capped for this expiry period

Type:
boolean
Source:

Methods

.call() → boolean

Returns whether or not this rate limit has been capped out for its current expiry period while incrementing calls towards the rate limit cap if not currently capped

Source:
Returns:
boolean

.setNotified() → void

Flag this RateLimit as having had a notification given for being capped for this expiry period

Source:
Returns:
void