From 662cb0cb0ac9c6f9ad93e180849476714bfceb0c Mon Sep 17 00:00:00 2001 From: kshitijanurag Date: Mon, 23 Mar 2026 02:38:51 +0530 Subject: [PATCH] feat(RESTJSONErrorCodes): add error code `50278` (#1587) --- deno/rest/common.ts | 19 +++++++++++++++++++ rest/common.ts | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/deno/rest/common.ts b/deno/rest/common.ts index 3c7e8b6d..7bd2db97 100644 --- a/deno/rest/common.ts +++ b/deno/rest/common.ts @@ -173,6 +173,9 @@ export enum RESTJSONErrorCodes { GuildWidgetDisabled, CannotEditMessageAuthoredByAnotherUser, CannotSendAnEmptyMessage, + /** + * @see {@link RESTJSONErrorCodes.CannotSendMessagesToThisUser_2} for a similar error code + */ CannotSendMessagesToThisUser, CannotSendMessagesInNonTextChannel, ChannelVerificationLevelTooHighForYouToGainAccess, @@ -270,6 +273,11 @@ export enum RESTJSONErrorCodes { ProvidedFileDoesNotHaveAValidDuration = 50_192, + /** + * @see {@link RESTJSONErrorCodes.CannotSendMessagesToThisUser} for a similar error code + */ + CannotSendMessagesToThisUser_2 = 50_278, + YouDoNotHavePermissionToSendThisSticker = 50_600, TwoFactorAuthenticationIsRequired = 60_003, @@ -339,6 +347,17 @@ export enum RESTJSONErrorCodes { InvalidClientSecret, } +/** + * JSON Error Codes that represent "Cannot send messages to this user". + * Discord uses two different error codes for this error: + * - {@link RESTJSONErrorCodes.CannotSendMessagesToThisUser} (50_007) + * - {@link RESTJSONErrorCodes.CannotSendMessagesToThisUser_2} (50_278) + */ +export const CannotSendMessagesToThisUserErrorCodes = [ + RESTJSONErrorCodes.CannotSendMessagesToThisUser, + RESTJSONErrorCodes.CannotSendMessagesToThisUser_2, +] as const; + /** * @see {@link https://discord.com/developers/docs/reference#locales} */ diff --git a/rest/common.ts b/rest/common.ts index 3c7e8b6d..7bd2db97 100644 --- a/rest/common.ts +++ b/rest/common.ts @@ -173,6 +173,9 @@ export enum RESTJSONErrorCodes { GuildWidgetDisabled, CannotEditMessageAuthoredByAnotherUser, CannotSendAnEmptyMessage, + /** + * @see {@link RESTJSONErrorCodes.CannotSendMessagesToThisUser_2} for a similar error code + */ CannotSendMessagesToThisUser, CannotSendMessagesInNonTextChannel, ChannelVerificationLevelTooHighForYouToGainAccess, @@ -270,6 +273,11 @@ export enum RESTJSONErrorCodes { ProvidedFileDoesNotHaveAValidDuration = 50_192, + /** + * @see {@link RESTJSONErrorCodes.CannotSendMessagesToThisUser} for a similar error code + */ + CannotSendMessagesToThisUser_2 = 50_278, + YouDoNotHavePermissionToSendThisSticker = 50_600, TwoFactorAuthenticationIsRequired = 60_003, @@ -339,6 +347,17 @@ export enum RESTJSONErrorCodes { InvalidClientSecret, } +/** + * JSON Error Codes that represent "Cannot send messages to this user". + * Discord uses two different error codes for this error: + * - {@link RESTJSONErrorCodes.CannotSendMessagesToThisUser} (50_007) + * - {@link RESTJSONErrorCodes.CannotSendMessagesToThisUser_2} (50_278) + */ +export const CannotSendMessagesToThisUserErrorCodes = [ + RESTJSONErrorCodes.CannotSendMessagesToThisUser, + RESTJSONErrorCodes.CannotSendMessagesToThisUser_2, +] as const; + /** * @see {@link https://discord.com/developers/docs/reference#locales} */