Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(RequestHandler): emit more info when a rate limit was hit #5801

Merged
merged 2 commits into from Jun 10, 2021

Conversation

SpaceEEC
Copy link
Member

Please describe the changes this PR makes and why it should be merged:

This PR adds more info into the string that gets emitted when a request gets a 429 response.
Being added is:

  • Whether the rate limit is global
  • The HTTP method / verb
  • The path of the request
  • The limit the rate limit bucket has
  • The timeout to wait for
  • Whether this is a sublimit (and if so, how long to wait)

I kept it similar to how the WebSocket emits debug events, since putting all of that into one line wasn't feasible:

`[CONNECT]
Gateway : ${gateway}
Version : ${client.options.ws.version}
Encoding : ${WebSocket.encoding}
Compression: ${zlib ? 'zlib-stream' : 'none'}`,

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

src/rest/RequestHandler.js Outdated Show resolved Hide resolved
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
@iCrawl iCrawl merged commit 18ac72e into discordjs:master Jun 10, 2021
@iCrawl iCrawl added this to the Version 13 milestone Jun 27, 2021
ckohen added a commit to ckohen/discord.js-modules that referenced this pull request Oct 31, 2021
ckohen added a commit to ckohen/discord.js-modules that referenced this pull request Dec 2, 2021
ckohen added a commit to ckohen/discord.js-modules that referenced this pull request Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants