Skip to content

Commit

Permalink
feat: add RESTRateLimit (#585)
Browse files Browse the repository at this point in the history
  • Loading branch information
almeidx committed Sep 14, 2022
1 parent 5c7e582 commit f4d3f4d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions deno/payloads/common.ts
Expand Up @@ -78,3 +78,21 @@ export interface RESTErrorGroupWrapper {
}

export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation | { [k: string]: RESTErrorData } | string;

/**
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
*/
export interface RESTRateLimit {
/**
* A value indicating if you are being globally rate limited or not
*/
global: boolean;
/**
* A message saying you are being rate limited.
*/
message: string;
/**
* The number of seconds to wait before submitting another request.
*/
retry_after: number;
}
18 changes: 18 additions & 0 deletions payloads/common.ts
Expand Up @@ -78,3 +78,21 @@ export interface RESTErrorGroupWrapper {
}

export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation | { [k: string]: RESTErrorData } | string;

/**
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
*/
export interface RESTRateLimit {
/**
* A value indicating if you are being globally rate limited or not
*/
global: boolean;
/**
* A message saying you are being rate limited.
*/
message: string;
/**
* The number of seconds to wait before submitting another request.
*/
retry_after: number;
}

1 comment on commit f4d3f4d

@vercel
Copy link

@vercel vercel bot commented on f4d3f4d Sep 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.