mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-17 12:03:31 +01:00
feat: expose Retry-After and sublimit timeouts in RatelimitData (#9864)
* feat: expose Retry-After and sublimit timeouts in RatelimitData * chore: better docs? * Apply suggestions from code review Co-authored-by: ckohen <chaikohen@gmail.com> --------- Co-authored-by: ckohen <chaikohen@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
@@ -17,7 +17,22 @@ export class RateLimitError extends Error implements RateLimitData {
|
||||
|
||||
public global: boolean;
|
||||
|
||||
public constructor({ timeToReset, limit, method, hash, url, route, majorParameter, global }: RateLimitData) {
|
||||
public retryAfter: number;
|
||||
|
||||
public sublimitTimeout: number;
|
||||
|
||||
public constructor({
|
||||
timeToReset,
|
||||
limit,
|
||||
method,
|
||||
hash,
|
||||
url,
|
||||
route,
|
||||
majorParameter,
|
||||
global,
|
||||
retryAfter,
|
||||
sublimitTimeout,
|
||||
}: RateLimitData) {
|
||||
super();
|
||||
this.timeToReset = timeToReset;
|
||||
this.limit = limit;
|
||||
@@ -27,6 +42,8 @@ export class RateLimitError extends Error implements RateLimitData {
|
||||
this.route = route;
|
||||
this.majorParameter = majorParameter;
|
||||
this.global = global;
|
||||
this.retryAfter = retryAfter;
|
||||
this.sublimitTimeout = sublimitTimeout;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user