mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 11:03:30 +01:00
feat: present x-ratelimit-scope for 429s hit (#9973)
* feat: present x-ratelimit-scope for 429s hit * fix: get scope from headers for burst too
This commit is contained in:
@@ -21,6 +21,8 @@ export class RateLimitError extends Error implements RateLimitData {
|
||||
|
||||
public sublimitTimeout: number;
|
||||
|
||||
public scope: RateLimitData['scope'];
|
||||
|
||||
public constructor({
|
||||
timeToReset,
|
||||
limit,
|
||||
@@ -32,6 +34,7 @@ export class RateLimitError extends Error implements RateLimitData {
|
||||
global,
|
||||
retryAfter,
|
||||
sublimitTimeout,
|
||||
scope,
|
||||
}: RateLimitData) {
|
||||
super();
|
||||
this.timeToReset = timeToReset;
|
||||
@@ -44,6 +47,7 @@ export class RateLimitError extends Error implements RateLimitData {
|
||||
this.global = global;
|
||||
this.retryAfter = retryAfter;
|
||||
this.sublimitTimeout = sublimitTimeout;
|
||||
this.scope = scope;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user