Skip to content

Commit

Permalink
feat: add RESTJSONErrorCode 40062 and RESTRateLimit.code (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
advaith1 committed Jan 5, 2023
1 parent 6e4a611 commit 4a25caf
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions deno/payloads/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation |
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
*/
export interface RESTRateLimit {
/**
* An error code for some limits
*
* {@link RESTJSONErrorCodes}
*/
code?: number;
/**
* A value indicating if you are being globally rate limited or not
*/
Expand Down
1 change: 1 addition & 0 deletions deno/rest/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export enum RESTJSONErrorCodes {

InteractionHasAlreadyBeenAcknowledged = 40060,
TagNamesMustBeUnique,
ServiceResourceIsBeingRateLimited,

ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40066,
TagRequiredToCreateAForumPostInThisChannel,
Expand Down
6 changes: 6 additions & 0 deletions payloads/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation |
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
*/
export interface RESTRateLimit {
/**
* An error code for some limits
*
* {@link RESTJSONErrorCodes}
*/
code?: number;
/**
* A value indicating if you are being globally rate limited or not
*/
Expand Down
1 change: 1 addition & 0 deletions rest/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export enum RESTJSONErrorCodes {

InteractionHasAlreadyBeenAcknowledged = 40060,
TagNamesMustBeUnique,
ServiceResourceIsBeingRateLimited,

ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40066,
TagRequiredToCreateAForumPostInThisChannel,
Expand Down

0 comments on commit 4a25caf

Please sign in to comment.