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(Rest): optional ratelimit errors #5659
Conversation
this can be configured via the disableRateLimitQueue client option, which may be an array of routes or a function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the onRateLimit function should also be added to typings
I have no idea how to look at the docs json in my browser so they are untested |
Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Is this better? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
@Vendicated if you could apply those changes requested we can move forward with merging this. |
sorry, I forgot 😅 |
Ported from discordjs/discord.js#5659 Co-authored-by: Ven <vendicated@riseup.net> Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Ported from discordjs/discord.js#5659 Co-authored-by: Ven <vendicated@riseup.net> Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Ported from discordjs/discord.js#5659 Co-authored-by: Ven <vendicated@riseup.net> Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Ported from discordjs/discord.js#5659 Co-authored-by: Ven <vendicated@riseup.net> Co-authored-by: SpaceEEC <spaceeec@yahoo.com>
Please describe the changes this PR makes and why it should be merged:
Adds new client option disableRateLimitQueue which takes either an array of routes or
(ratelimitData) => boolean
.If a rate limit is hit, the RequestHandler first checks whether this rate limit should be thrown (route starts with one of the array values / function returns true) and if so throws an error instead of queueing the request
This closes #5449
Status and versioning classification: