bot.onRateLimit
An event that gets executed, if the bot gets rate limited by the Discord API. To let the bot listen to the event, add one bot.onRateLimit() callback inside your mainfile.
This callback triggers every time your bot gets rate limited by the Discord API.

Example Template

1
bot.rateLimitCommand({ //command
2
channel: "ID" //The channel we're the log is
3
code: `your code` //Code
4
})
Copied!

Example Usage

1
bot.rateLimitCommand({
2
channel: "772414449839636490"
3
code: `I've been rate limited!
4
Timeout: $rateLimt[timeout]
5
Limit: $rateLimit[limit]
6
Method: $rateLimit[method]
7
Path: $rateLimit[path]
8
Route: $rateLimit[route]
9
`
10
})
Copied!

Options for $rateLimit

  • timeout - Time before this session rate limit is restarted
  • limit - Amount of times you can request this endpoint before failing
  • method - Method used to this endpoint
  • path - The path to the api endpoint that triggered the rate limit
  • route - The route that triggered this event
Last modified 1mo ago
Copy link
Edit on GitHub