RateLimiter

Handles assigning ratelimits to guildmembers and users

Constructor

new RateLimiter(limit: string, global: boolean)

Parameters:
Name Type Description
limit
string

Ratelimit string matching the regex \d+\/\d+[s|m|h|d]
Example: 1/10m to limit a command to one use per 10 minutes

global
boolean

Whether or not this RateLimiter handles global ratelimits

Source:

Methods

.get(message: Message, userOverride: User)RateLimit

Returns the RateLimit object for the message author if global or message member if message is in a guild. If a userOverride is given then the RateLimit or global RateLimit will be retrieved for that user based on the message location

Parameters:
Name Type Description
message
Message

Discord.js Message object

userOverride
User

User object to use in place of Message author

Source:
Returns:
RateLimit