From 4a25caf506c685a8e0af630eef3bd3d2735d64ed Mon Sep 17 00:00:00 2001 From: advaith Date: Thu, 5 Jan 2023 03:38:37 -0800 Subject: [PATCH] feat: add RESTJSONErrorCode `40062` and RESTRateLimit.code (#620) --- deno/payloads/common.ts | 6 ++++++ deno/rest/common.ts | 1 + payloads/common.ts | 6 ++++++ rest/common.ts | 1 + 4 files changed, 14 insertions(+) diff --git a/deno/payloads/common.ts b/deno/payloads/common.ts index 52aa979ad..aeb76d666 100644 --- a/deno/payloads/common.ts +++ b/deno/payloads/common.ts @@ -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 */ diff --git a/deno/rest/common.ts b/deno/rest/common.ts index e3ec002e5..55ebf29ea 100644 --- a/deno/rest/common.ts +++ b/deno/rest/common.ts @@ -143,6 +143,7 @@ export enum RESTJSONErrorCodes { InteractionHasAlreadyBeenAcknowledged = 40060, TagNamesMustBeUnique, + ServiceResourceIsBeingRateLimited, ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40066, TagRequiredToCreateAForumPostInThisChannel, diff --git a/payloads/common.ts b/payloads/common.ts index e3382f76d..7d4b76538 100644 --- a/payloads/common.ts +++ b/payloads/common.ts @@ -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 */ diff --git a/rest/common.ts b/rest/common.ts index e3ec002e5..55ebf29ea 100644 --- a/rest/common.ts +++ b/rest/common.ts @@ -143,6 +143,7 @@ export enum RESTJSONErrorCodes { InteractionHasAlreadyBeenAcknowledged = 40060, TagNamesMustBeUnique, + ServiceResourceIsBeingRateLimited, ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40066, TagRequiredToCreateAForumPostInThisChannel,