From 899ce1a7a52edf07669082d26a557b590c20cac9 Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Sat, 18 Dec 2021 15:39:26 +0700 Subject: [PATCH 1/2] opcodes jsdoc --- src/types/codes/gatewayCloseEventCodes.ts | 14 +++ src/types/codes/gatewayOpcodes.ts | 13 +- src/types/codes/httpResponseCodes.ts | 11 ++ src/types/codes/jsonErrorCodes.ts | 144 ++++++++++++++++++++++ src/types/codes/rpcCloseEventCodes.ts | 6 + src/types/codes/rpcErrorCodes.ts | 16 +++ src/types/codes/voiceCloseEventCodes.ts | 11 ++ src/types/codes/voiceOpcodes.ts | 11 ++ 8 files changed, 225 insertions(+), 1 deletion(-) diff --git a/src/types/codes/gatewayCloseEventCodes.ts b/src/types/codes/gatewayCloseEventCodes.ts index 94f4dfebf..65292cf0f 100644 --- a/src/types/codes/gatewayCloseEventCodes.ts +++ b/src/types/codes/gatewayCloseEventCodes.ts @@ -1,17 +1,31 @@ /** https://discord.com/developers/docs/topics/opcodes-and-status-codes#opcodes-and-status-codes */ export enum GatewayCloseEventCodes { + /** We're not sure what went wrong. Try reconnecting? */ UnknownError = 4000, + /** You sent an invalid [Gateway opcode](https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes) or an invalid payload for an opcode. Don't do that! */ UnknownOpcode, + /** You sent an invalid [payload](https://discord.com/developers/docs/topics/gateway#sending-payloads) to us. Don't do that! */ DecodeError, + /** You sent us a payload prior to [identifying](https://discord.com/developers/docs/topics/gateway#identify). */ NotAuthenticated, + /** The account token sent with your [identify payload](https://discord.com/developers/docs/topics/gateway#identify) is incorrect. */ AuthenticationFailed, + /** You sent more than one identify payload. Don't do that! */ AlreadyAuthenticated, + /** The sequence sent when [resuming](https://discord.com/developers/docs/topics/gateway#resume) the session was invalid. Reconnect and start a new session. */ InvalidSeq = 4007, + /** Woah nelly! You're sending payloads to us too quickly. Slow it down! You will be disconnected on receiving this. */ RateLimited, + /** Your session timed out. Reconnect and start a new one. */ SessionTimedOut, + /** You sent us an invalid [shard when identifying](https://discord.com/developers/docs/topics/gateway#sharding). */ InvalidShard, + /** The session would have handled too many guilds - you are required to [shard](https://discord.com/developers/docs/topics/gateway#sharding) your connection in order to connect. */ ShardingRequired, + /** You sent an invalid version for the gateway. */ InvalidApiVersion, + /** You sent an invalid intent for a [Gateway Intent](https://discord.com/developers/docs/topics/gateway#gateway-intents). You may have incorrectly calculated the bitwise value. */ InvalidIntents, + /** You sent a disallowed intent for a [Gateway Intent](https://discord.com/developers/docs/topics/gateway#gateway-intents). You may have tried to specify an intent that you [have not enabled or are not approved for](https://discord.com/developers/docs/topics/gateway#privileged-intents). */ DisallowedIntents, } diff --git a/src/types/codes/gatewayOpcodes.ts b/src/types/codes/gatewayOpcodes.ts index 6768a050e..a58634185 100644 --- a/src/types/codes/gatewayOpcodes.ts +++ b/src/types/codes/gatewayOpcodes.ts @@ -1,14 +1,25 @@ /** https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes */ export enum GatewayOpcodes { + /** An event was dispatched. */ Dispatch, + /** Fired periodically by the client to keep the connection alive. */ Heartbeat, + /** Starts a new session during the initial handshake. */ Identify, - StatusUpdate, + /** Update the client's presence. */ + PresenceUpdate, + /** Used to join/leave or move between voice channels. */ VoiceStateUpdate, + /** Resume a previous session that was disconnected. */ Resume = 6, + /** You should attempt to reconnect and resume immediately. */ Reconnect, + /** Request information about offline guild members in a large guild. */ RequestGuildMembers, + /** The session has been invalidated. You should reconnect and identify/resume accordingly. */ InvalidSession, + /** Sent immediately after connecting, contains the `heartbeat_interval` to use. */ Hello, + /** Sent in response to receiving a heartbeat to acknowledge that it has been received. */ HeartbeatACK, } diff --git a/src/types/codes/httpResponseCodes.ts b/src/types/codes/httpResponseCodes.ts index cc8242a0a..b6117460b 100644 --- a/src/types/codes/httpResponseCodes.ts +++ b/src/types/codes/httpResponseCodes.ts @@ -1,14 +1,25 @@ /** https://discord.com/developers/docs/topics/opcodes-and-status-codes#http */ export enum HTTPResponseCodes { + /** The request completed successfully. */ Ok = 200, + /** The entity was created successfully. */ Created, + /** The request completed successfully but returned no content. */ NoContent = 204, + /** The entity was not modified (no action was taken). */ NotModified = 304, + /** The request was improperly formatted, or the server couldn't understand it. */ BadRequest = 400, + /** The `Authorization` header was missing or invalid. */ Unauthorized, + /** The `Authorization` token you passed did not have permission to the resource. */ Forbidden = 403, + /** The resource at the location specified doesn't exist. */ NotFound, + /** The HTTP method used is not valid for the location specified. */ MethodNotAllowed, + /** You are being rate limited, see [Rate Limits](https://discord.com/developers/docs/topics/rate-limits). */ TooManyRequests = 429, + /** There was not a gateway available to process your request. Wait a bit and retry. */ GatewayUnavailable = 502, } diff --git a/src/types/codes/jsonErrorCodes.ts b/src/types/codes/jsonErrorCodes.ts index eadf39c6a..abc11fad0 100644 --- a/src/types/codes/jsonErrorCodes.ts +++ b/src/types/codes/jsonErrorCodes.ts @@ -1,148 +1,292 @@ /** https://discord.com/developers/docs/topics/opcodes-and-status-codes#json */ export enum JsonErrorCodes { + /** General error (such as a malformed request body, amongst other things) */ GeneralError, + /** Unknown account */ UnknownAccount = 10001, + /** Unknown application */ UnknownApplication, + /** Unknown channel */ UnknownChannel, + /** Unknown guild */ UnknownGuild, + /** Unknown integration */ UnknownIntegration, + /** Unknown invite */ UnknownInvite, + /** Unknown member */ UnknownMember, + /** Unknown message */ UnknownMessage, + /** Unknown permission overwrite */ UnknownPermissionOverwrite, + /** Unknown provider */ UnknownProvider, + /** Unknown role */ UnknownRole, + /** Unknown token */ UnknownToken, + /** Unknown user */ UnknownUser, + /** Unknown emoji */ UnknownEmoji, + /** Unknown webhook */ UnknownWebhook, + /** Unknown webhook service */ UnknownWebhookService, + /** Unknown session */ UnknownSession = 10020, + /** Unknown ban */ UnknownBan = 10026, + /** Unknown SKU */ UnknownSKU, + /** Unknown Store Listing */ UnknownStoreListing, + /** Unknown entitlement */ UnknownEntitlement, + /** Unknown build */ UnknownBuild, + /** Unknown lobby */ UnknownLobby, + /** Unknown branch */ UnknownBranch, + /** Unknown store directory layout */ UnknownStoreDirectoryLayout, + /** Unknown redistributable */ UnknownRedistributable = 10036, + /** Unknown gift code */ UnknownGiftCode = 10038, + /** Unknown stream */ UnknownStream = 10049, + /** Unknown premium server subscribe cooldown */ UnknownPremiumServerSubscribeCooldown, + /** Unknown guild template */ UnknownGuildTemplate = 10057, + /** Unknown discoverable server category */ UnknownDiscoveryCategory = 10059, + /** Unknown sticker */ UnknownSticker, + /** Unknown interaction */ UnknownInteraction = 10062, + /** Unknown application command */ UnknownApplicationCommand = 10063, + /** Unknown application command permissions */ UnknownApplicationCommandPermissions = 10066, + /** Unknown Stage Instance */ UnknownStageInstance, + /** Unknown Guild Member Verification Form */ UnknownGuildMemberVerificationForm, + /** Unknown Guild Welcome Screen */ UnknownGuildWelcomeScreen, + /** Unknown Guild Scheduled Event */ UnknownGuildScheduledEvent, + /** Unknown Guild Scheduled Event User */ UnknownGuildScheduledEventUser, + /** Bots cannot use this endpoint */ BotsCannotUseThisEndpoint = 20001, + /** Only bots can use this endpoint */ OnlyBotsCanUseThisEndpoint, + /** Explicit content cannot be sent to the desired recipient(s) */ ExplicitContentCannotBeSentToTheDesiredRecipient = 20009, + /** You are not authorized to perform this action on this application */ YouAreNotAuthorizedToPerformThisActionOnThisApplication = 20012, + /** This action cannot be performed due to slowmode rate limit */ ThisActionCannotBePerformedDueToSlowmodeRateLimit = 20016, + /** Only the owner of this account can perform this action */ OnlyTheOwnerOfThisAccountCanPerformThisAction = 20018, + /** This message cannot be edited due to announcement rate limits */ ThisMessageCannotBeEditedDueToAnnouncementRateLimits = 20022, + /** The channel you are writing has hit the write rate limit */ TheChannelYouAreWritingHasHitTheWriteRateLimit = 20028, + /** The channel you are writing has hit the write rate limit */ TheWriteActionYouArePerformingOnTheServerHasHitTheWriteRateLimit, + /** Your Stage topic, server name, server description, or channel names contain words that are not allowed */ YourStageTopicOrServerNameOrServerDescriptionOrChannelNamesContainsWordsThatAreNotAllowedForPublicStages = 20031, + /** Guild premium subscription level too low */ GuildPremiumSubscriptionLevelTooLow = 20035, + /** Maximum number of guilds reached (100) */ MaximumNumberOfGuildsReached = 30001, + /** Maximum number of friends reached (1000) */ MaximumNumberOfFriendsReached, + /** Maximum number of pins reached for the channel (50) */ MaximumNumberOfPinsReachedForTheChannel, + /** Maximum number of recipients reached (10) */ MaximumNumberOfRecipientsReached, + /** Maximum number of guild roles reached (250) */ MaximumNumberOfGuildRolesReached, + /** Maximum number of webhooks reached (10) */ MaximumNumberOfWebhooksReached = 30007, + /** Maximum number of emojis reached */ MaximumNumberOfEmojisReached, + /** Maximum number of reactions reached (20) */ MaximumNumberOfReactionsReached = 30010, + /** Maximum number of guild channels reached (500) */ MaximumNumberOfGuildChannelsReached = 30013, + /** Maximum number of attachments in a message reached (10) */ MaximumNumberOfAttachmentsInAMessageReached = 30015, + /** Maximum number of invites reached (1000) */ MaximumNumberOfInvitesReached, + /** Maximum number of animated emojis reached */ MaximumNumberOfAnimatedEmojisReached = 30018, + /** Maximum number of server members reached */ MaximumNumberOfServerMembersReached, + /** Maximum number of server categories has been reached (5) */ MaximumNumberOfServerCategoriesHasBeenReached = 30030, + /** Guild already has a template */ GuildAlreadyHasTemplate = 30031, + /** Max number of thread participants has been reached (1000) */ MaxNumberOfThreadParticipantsHasBeenReached = 30033, + /** Maximum number of bans for non-guild members have been exceeded */ MaximumNumberOfBansForNonGuildMembersHaveBeenExceeded = 30035, + /** Maximum number of bans fetches has been reached */ MaximumNumberOfBansFetchesHasBeenReached = 30037, + /** Maximum number of uncompleted guild scheduled events reached (100) */ MaximumNumberOfUncompletedGuildScheduledEventsReached = 30038, + /** Maximum number of stickers reached */ MaximumNumberOfStickersReached = 30039, + /** Maximum number of prune requests has been reached. Try again later */ MaximumNumberOfPruneRequestsHasBeenReachedTryAgainLater, + /** Maximum number of prune requests has been reached. Try again later */ MaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReachedTryAgainLater = 30042, + /** Unauthorized. Provide a valid token and try again */ UnauthorizedProvideAValidTokenAndTryAgain = 40001, + /** You need to verify your account in order to perform this action */ YouNeedToVerifyYourAccountInOrderToPerformThisAction, + /** You are opening direct messages too fast */ YouAreOpeningDirectMessagesTooFast, + /** Request entity too large. Try sending something smaller in size */ RequestEntityTooLargeTrySendingSomethingSmallerInSize = 40005, + /** This feature has been temporarily disabled server-side */ ThisFeatureHasBeenTemporarilyDisabledServerSide, + /** The user is banned from this guild */ ThisUserBannedFromThisGuild, + /** Target user is not connected to voice */ TargetUserIsNotConnectedToVoice = 40032, + /** This message has already been crossposted */ ThisMessageHasAlreadyBeenCrossposted = 40033, + /** An application command with that name already exists */ AnApplicationCommandWithThatNameAlreadyExists = 40041, + /** Missing access */ MissingAccess = 50001, + /** Invalid account type */ InvalidAccountType, + /** Cannot execute action on a DM channel */ CannotExecuteActionOnADMChannel, + /** Guild widget disabled */ GuildWidgetDisabled, + /** Cannot edit a message authored by another user */ CannotEditMessageAuthoredByAnotherUser, + /** Cannot send an empty message */ CannotSendAnEmptyMessage, + /** Cannot send an empty message */ CannotSendMessagesToThisUser, + /** Cannot send messages in a voice channel */ CannotSendMessagesInAVoiceChannel, + /** Channel verification level is too high for you to gain access */ ChannelVerificationLevelIsTooHighForYouToGainAccess, + /** OAuth2 application does not have a bot */ OAuth2ApplicationDoesNotHaveABot, + /** OAuth2 application limit reached */ OAuth2ApplicationLimitReached, + /** Invalid OAuth2 state */ InvalidOAuth2State, + /** You lack permissions to perform that action */ YouLackPermissionsToPerformThatAction, + /** Invalid authentication token provided */ InvalidAuthenticationTokenProvided, + /** Note was too long */ NoteWasTooLong, + /** Provided too few or too many messages to delete. Must provide at least 2 and fewer than 100 messages to delete */ ProvidedTooFewOrTooManyMessagesToDeleteMustProvideAtLeast2AndFewerThan100MessagesToDelete, + /** A message can only be pinned to the channel it was sent in */ AMessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019, + /** Invite code was either invalid or taken */ InviteCodeWasEitherInvalidOrTaken, + /** Cannot execute action on a system message */ CannotExecuteActionOnASystemMessage, + /** Cannot execute action on this channel type */ CannotExecuteActionOnThisChannelType = 50024, + /** Invalid OAuth2 access token provided */ InvalidOAuth2AccessTokenProvided, + /** Missing required OAuth2 scope */ MissingRequiredOAuth2Scope, + /** Invalid webhook token provided */ InvalidWebhookTokenProvided, + /** Invalid role */ InvalidRole, + /** Invalid Recipient(s) */ InvalidRecipients = 50033, + /** A message provided was too old to bulk delete */ AMessageProvidedWasTooOldToBulkDelete, + /** Invalid form body (returned for both `application/json` and `multipart/form-data` bodies), or invalid `Content-Type` provided */ InvalidFormBodyOrContentTypeProvided, + /** An invite was accepted to a guild the application's bot is not in */ AnInviteWasAcceptedToAGuildTheApplicationsBotIsNotIn, + /** Invalid API version provided */ InvalidApiVersionProvided = 50041, + /** File uploaded exceeds the maximum size */ FileUploadedExceedsTheMaximumSize = 50045, + /** Invalid file uploaded */ InvalidFileUploaded, + /** Cannot self-redeem this gift */ CannotSelfRedeemThisGift = 50054, + /** Invalid Guild */ InvalidGuild, + /** Payment source required to redeem gift */ PaymentSourceRequiredToRedeemGift = 50070, + /** Cannot delete a channel required for Community guilds */ CannotDeleteAChannelRequiredForCommunityGuilds = 50074, + /** Invalid sticker sent */ InvalidStickerSent = 50081, + /** Tried to perform an operation on an archived thread, such as editing a message or adding a user to the thread */ TriedToPerformAnOperationOnAnArchivedThreadSuchAsEditingAMessageOrAddingAUserToTheThread = 50083, + /** Invalid thread notification settings */ InvalidThreadNotificationSettings, + /** `before` value is earlier than the thread creation date */ BeforeValueIsEarlierThanTheThreadCreationDate, + /** This server is not available in your location */ ThisServerIsNotAvailableInYourLocation = 50095, + /** This server needs monetization enabled in order to perform this action */ ThisServerNeedsMonetizationEnabledInOrderToPerformThisAction = 50097, + /** This server needs more boosts to perform this action */ ThisServerNeedsMoreBoostsToPerformThisAction = 50101, + /** The request body contains invalid JSON. */ TheRequestBodyContainsInvalidJSON = 50109, TwoFactorIsRequiredForThisOperation = 60003, + /** No users with DiscordTag exist */ NoUsersWithDiscordTagExist = 80004, + /** Reaction was blocked */ ReactionWasBlocked = 90001, + /** API resource is currently overloaded. Try again a little later */ ApiResourceIsCurrentlyOverloadedTryAgainALittleLater = 130000, + /** The Stage is already open */ TheStageIsAlreadyOpen = 150006, + /** Cannot reply without permission to read message history */ CannotReplyWithoutPermissionToReadMessageHistory = 160002, + /** A thread has already been created for this message */ AThreadHasAlreadyBeenCreatedForThisMessage = 160004, + /** Thread is locked */ ThreadIsLocked = 160005, + /** Maximum number of active threads reached */ MaximumNumberOfActiveThreadsReached = 160006, + /** Maximum number of active announcement threads reached */ MaximumNumberOfActiveAnnouncementThreadsReached = 160007, + /** Invalid JSON for uploaded Lottie file */ InvalidJsonForUploadedLottieFile = 170001, + /** Uploaded Lotties cannot contain rasterized images such as PNG or JPEG */ UploadedLottiesCannotContainRasterizedImagesSuchAsPngOrJpeg, + /** Sticker maximum framerate exceeded */ StickerMaximumFramerateExceeded, + /** Sticker frame count exceeds maximum of 1000 frames */ StickerFrameCountExceedsMaximumOf1000Frames, + /** Lottie animation maximum dimensions exceeded */ LottieAnimationMaximumDimensionsExceeded, + /** Sticker frame rate is either too small or too large */ StickerFrameRateIsEitherTooSmallOrTooLarge, + /** Sticker animation duration exceeds maximum of 5 seconds */ StickerAnimationDurationExceedsMaximumOf5Seconds, + /** Cannot update a finished event */ CannotUpdateAFinishedEvent = 180000, + /** Failed to create stage needed for stage event */ FailedToCreateStageNeededForStageEvent = 180002, } diff --git a/src/types/codes/rpcCloseEventCodes.ts b/src/types/codes/rpcCloseEventCodes.ts index c7075f6d2..9f1c951c7 100644 --- a/src/types/codes/rpcCloseEventCodes.ts +++ b/src/types/codes/rpcCloseEventCodes.ts @@ -1,9 +1,15 @@ /** https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc */ export enum RpcCloseEventCodes { + /** You connected to the RPC server with an invalid client ID. */ InvalidClientId = 4000, + /** You connected to the RPC server with an invalid origin. */ InvalidOrigin, + /** You are being rate limited. */ RateLimited, + /** The OAuth2 token associated with a connection was revoked, get a new one! */ TokenRevoked, + /** The RPC Server version specified in the connection string was not valid. */ InvalidVersion, + /** The encoding specified in the connection string was not valid. */ InvalidEncoding, } diff --git a/src/types/codes/rpcErrorCodes.ts b/src/types/codes/rpcErrorCodes.ts index 76cdc38f0..414f15e36 100644 --- a/src/types/codes/rpcErrorCodes.ts +++ b/src/types/codes/rpcErrorCodes.ts @@ -1,19 +1,35 @@ /** https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc */ export enum RpcErrorCodes { + /** An unknown error occurred. */ UnknownError = 1000, + /** You sent an invalid payload. */ InvalidPayload = 4000, + /** Invalid command name specified. */ InvalidCommand = 4002, + /** Invalid guild ID specified. */ InvalidGuild, + /** Invalid event name specified. */ InvalidEvent, + /** Invalid channel ID specified. */ InvalidChannel, + /** You lack permissions to access the given resource. */ InvalidPermissions, + /** An invalid OAuth2 application ID was used to authorize or authenticate with. */ InvalidClientId, + /** An invalid OAuth2 application origin was used to authorize or authenticate with. */ InvalidOrigin, + /** An invalid OAuth2 token was used to authorize or authenticate with. */ InvalidToken, + /** The specified user ID was invalid. */ InvalidUser, + /** A standard OAuth2 error occurred; check the data object for the OAuth2 error details. */ OAuth2Error = 5000, + /** An asynchronous `SELECT_TEXT_CHANNEL`/`SELECT_VOICE_CHANNEL` command timed out. */ SelectChannelTimedOut, + /** An asynchronous `GET_GUILD` command timed out. */ GetGuildTimedOut, + /** You tried to join a user to a voice channel but the user was already in one. */ SelectVoiceForceRequired, + /** You tried to capture more than one shortcut key at once. */ CaptureShortcutAlreadyListening, } diff --git a/src/types/codes/voiceCloseEventCodes.ts b/src/types/codes/voiceCloseEventCodes.ts index 414a69e2d..c4027c39e 100644 --- a/src/types/codes/voiceCloseEventCodes.ts +++ b/src/types/codes/voiceCloseEventCodes.ts @@ -1,16 +1,27 @@ /** https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice */ export enum VoiceCloseEventCodes { + /** You sent an invalid [opcode](https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes). */ UnknownOpcode = 4001, + /** You sent a invalid payload in your [identifying](https://discord.com/developers/docs/topics/gateway#identify) to the Gateway. */ FailedToDecodePayload, + /** You sent a payload before [identifying](https://discord.com/developers/docs/topics/gateway#identify) with the Gateway. */ NotAuthenticated, + /** The token you sent in your [identify](https://discord.com/developers/docs/topics/gateway#identify) payload is incorrect. */ AuthenticationFailed, + /** You sent more than one [identify](https://discord.com/developers/docs/topics/gateway#identify) payload. Stahp. */ AlreadyAuthenticated, + /** Your session is no longer valid. */ SessionNoLongerValid, + /** Your session has timed out. */ SessionTimedOut = 4009, + /** We can't find the server you're trying to connect to. */ ServerNotFound = 4011, + /** We didn't recognize the [protocol](https://discord.com/developers/docs/topics/voice-connections#establishing-a-voice-udp-connection-example-select-protocol-payload) you sent. */ UnknownProtocol, /** Channel was deleted, you were kicked, voice server changed, or the main gateway session was dropped. Should not reconnect. */ Disconnect = 4014, + /** The server crashed. Our bad! Try [resuming](https://discord.com/developers/docs/topics/voice-connections#resuming-voice-connection). */ VoiceServerCrashed, + /** We didn't recognize your [encryption](https://discord.com/developers/docs/topics/voice-connections#encrypting-and-sending-voice). */ UnknownEncryptionMode, } diff --git a/src/types/codes/voiceOpcodes.ts b/src/types/codes/voiceOpcodes.ts index e1f15ddb8..8fb942428 100644 --- a/src/types/codes/voiceOpcodes.ts +++ b/src/types/codes/voiceOpcodes.ts @@ -1,14 +1,25 @@ /** https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice */ export enum VoiceOpcodes { + /** Begin a voice websocket connection. */ Identify, + /** Select the voice protocol. */ SelectProtocol, + /** Complete the websocket handshake. */ Ready, + /** Keep the websocket connection alive. */ Heartbeat, + /** Describe the session. */ SessionDescription, + /** Indicate which users are speaking. */ Speaking, + /** Sent to acknowledge a received client heartbeat. */ HeartbeatACK, + /** Resume a connection. */ Resume, + /** Time to wait between sending heartbeats in milliseconds. */ Hello, + /** Acknowledge a successful session resume. */ Resumed, + /** A client has disconnected from the voice channel */ ClientDisconnect = 13, } From e63c03160bc37b2bcee4bb925efbfd530918d568 Mon Sep 17 00:00:00 2001 From: lts20050703 <87189679+lts20050703@users.noreply.github.com> Date: Mon, 20 Dec 2021 12:49:13 +0700 Subject: [PATCH 2/2] Yeet "exact word by word" jsdoc comments --- src/types/codes/jsonErrorCodes.ts | 142 ------------------------------ 1 file changed, 142 deletions(-) diff --git a/src/types/codes/jsonErrorCodes.ts b/src/types/codes/jsonErrorCodes.ts index abc11fad0..1243fe4c0 100644 --- a/src/types/codes/jsonErrorCodes.ts +++ b/src/types/codes/jsonErrorCodes.ts @@ -2,291 +2,149 @@ export enum JsonErrorCodes { /** General error (such as a malformed request body, amongst other things) */ GeneralError, - /** Unknown account */ UnknownAccount = 10001, - /** Unknown application */ UnknownApplication, - /** Unknown channel */ UnknownChannel, - /** Unknown guild */ UnknownGuild, - /** Unknown integration */ UnknownIntegration, - /** Unknown invite */ UnknownInvite, - /** Unknown member */ UnknownMember, - /** Unknown message */ UnknownMessage, - /** Unknown permission overwrite */ UnknownPermissionOverwrite, - /** Unknown provider */ UnknownProvider, - /** Unknown role */ UnknownRole, - /** Unknown token */ UnknownToken, - /** Unknown user */ UnknownUser, - /** Unknown emoji */ UnknownEmoji, - /** Unknown webhook */ UnknownWebhook, - /** Unknown webhook service */ UnknownWebhookService, - /** Unknown session */ UnknownSession = 10020, - /** Unknown ban */ UnknownBan = 10026, - /** Unknown SKU */ UnknownSKU, - /** Unknown Store Listing */ UnknownStoreListing, - /** Unknown entitlement */ UnknownEntitlement, - /** Unknown build */ UnknownBuild, - /** Unknown lobby */ UnknownLobby, - /** Unknown branch */ UnknownBranch, - /** Unknown store directory layout */ UnknownStoreDirectoryLayout, - /** Unknown redistributable */ UnknownRedistributable = 10036, - /** Unknown gift code */ UnknownGiftCode = 10038, - /** Unknown stream */ UnknownStream = 10049, - /** Unknown premium server subscribe cooldown */ UnknownPremiumServerSubscribeCooldown, - /** Unknown guild template */ UnknownGuildTemplate = 10057, - /** Unknown discoverable server category */ UnknownDiscoveryCategory = 10059, - /** Unknown sticker */ UnknownSticker, - /** Unknown interaction */ UnknownInteraction = 10062, - /** Unknown application command */ UnknownApplicationCommand = 10063, - /** Unknown application command permissions */ UnknownApplicationCommandPermissions = 10066, - /** Unknown Stage Instance */ UnknownStageInstance, - /** Unknown Guild Member Verification Form */ UnknownGuildMemberVerificationForm, - /** Unknown Guild Welcome Screen */ UnknownGuildWelcomeScreen, - /** Unknown Guild Scheduled Event */ UnknownGuildScheduledEvent, - /** Unknown Guild Scheduled Event User */ UnknownGuildScheduledEventUser, - /** Bots cannot use this endpoint */ BotsCannotUseThisEndpoint = 20001, - /** Only bots can use this endpoint */ OnlyBotsCanUseThisEndpoint, - /** Explicit content cannot be sent to the desired recipient(s) */ ExplicitContentCannotBeSentToTheDesiredRecipient = 20009, - /** You are not authorized to perform this action on this application */ YouAreNotAuthorizedToPerformThisActionOnThisApplication = 20012, - /** This action cannot be performed due to slowmode rate limit */ ThisActionCannotBePerformedDueToSlowmodeRateLimit = 20016, - /** Only the owner of this account can perform this action */ OnlyTheOwnerOfThisAccountCanPerformThisAction = 20018, - /** This message cannot be edited due to announcement rate limits */ ThisMessageCannotBeEditedDueToAnnouncementRateLimits = 20022, - /** The channel you are writing has hit the write rate limit */ TheChannelYouAreWritingHasHitTheWriteRateLimit = 20028, - /** The channel you are writing has hit the write rate limit */ TheWriteActionYouArePerformingOnTheServerHasHitTheWriteRateLimit, - /** Your Stage topic, server name, server description, or channel names contain words that are not allowed */ YourStageTopicOrServerNameOrServerDescriptionOrChannelNamesContainsWordsThatAreNotAllowedForPublicStages = 20031, - /** Guild premium subscription level too low */ GuildPremiumSubscriptionLevelTooLow = 20035, - /** Maximum number of guilds reached (100) */ MaximumNumberOfGuildsReached = 30001, - /** Maximum number of friends reached (1000) */ MaximumNumberOfFriendsReached, - /** Maximum number of pins reached for the channel (50) */ MaximumNumberOfPinsReachedForTheChannel, - /** Maximum number of recipients reached (10) */ MaximumNumberOfRecipientsReached, - /** Maximum number of guild roles reached (250) */ MaximumNumberOfGuildRolesReached, - /** Maximum number of webhooks reached (10) */ MaximumNumberOfWebhooksReached = 30007, - /** Maximum number of emojis reached */ MaximumNumberOfEmojisReached, - /** Maximum number of reactions reached (20) */ MaximumNumberOfReactionsReached = 30010, - /** Maximum number of guild channels reached (500) */ MaximumNumberOfGuildChannelsReached = 30013, - /** Maximum number of attachments in a message reached (10) */ MaximumNumberOfAttachmentsInAMessageReached = 30015, - /** Maximum number of invites reached (1000) */ MaximumNumberOfInvitesReached, - /** Maximum number of animated emojis reached */ MaximumNumberOfAnimatedEmojisReached = 30018, - /** Maximum number of server members reached */ MaximumNumberOfServerMembersReached, - /** Maximum number of server categories has been reached (5) */ MaximumNumberOfServerCategoriesHasBeenReached = 30030, - /** Guild already has a template */ GuildAlreadyHasTemplate = 30031, - /** Max number of thread participants has been reached (1000) */ MaxNumberOfThreadParticipantsHasBeenReached = 30033, - /** Maximum number of bans for non-guild members have been exceeded */ MaximumNumberOfBansForNonGuildMembersHaveBeenExceeded = 30035, - /** Maximum number of bans fetches has been reached */ MaximumNumberOfBansFetchesHasBeenReached = 30037, - /** Maximum number of uncompleted guild scheduled events reached (100) */ MaximumNumberOfUncompletedGuildScheduledEventsReached = 30038, - /** Maximum number of stickers reached */ MaximumNumberOfStickersReached = 30039, - /** Maximum number of prune requests has been reached. Try again later */ MaximumNumberOfPruneRequestsHasBeenReachedTryAgainLater, - /** Maximum number of prune requests has been reached. Try again later */ MaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReachedTryAgainLater = 30042, - /** Unauthorized. Provide a valid token and try again */ UnauthorizedProvideAValidTokenAndTryAgain = 40001, - /** You need to verify your account in order to perform this action */ YouNeedToVerifyYourAccountInOrderToPerformThisAction, - /** You are opening direct messages too fast */ YouAreOpeningDirectMessagesTooFast, - /** Request entity too large. Try sending something smaller in size */ RequestEntityTooLargeTrySendingSomethingSmallerInSize = 40005, - /** This feature has been temporarily disabled server-side */ ThisFeatureHasBeenTemporarilyDisabledServerSide, - /** The user is banned from this guild */ ThisUserBannedFromThisGuild, - /** Target user is not connected to voice */ TargetUserIsNotConnectedToVoice = 40032, - /** This message has already been crossposted */ ThisMessageHasAlreadyBeenCrossposted = 40033, - /** An application command with that name already exists */ AnApplicationCommandWithThatNameAlreadyExists = 40041, - /** Missing access */ MissingAccess = 50001, - /** Invalid account type */ InvalidAccountType, - /** Cannot execute action on a DM channel */ CannotExecuteActionOnADMChannel, - /** Guild widget disabled */ GuildWidgetDisabled, - /** Cannot edit a message authored by another user */ CannotEditMessageAuthoredByAnotherUser, - /** Cannot send an empty message */ CannotSendAnEmptyMessage, - /** Cannot send an empty message */ CannotSendMessagesToThisUser, - /** Cannot send messages in a voice channel */ CannotSendMessagesInAVoiceChannel, - /** Channel verification level is too high for you to gain access */ ChannelVerificationLevelIsTooHighForYouToGainAccess, - /** OAuth2 application does not have a bot */ OAuth2ApplicationDoesNotHaveABot, - /** OAuth2 application limit reached */ OAuth2ApplicationLimitReached, - /** Invalid OAuth2 state */ InvalidOAuth2State, - /** You lack permissions to perform that action */ YouLackPermissionsToPerformThatAction, - /** Invalid authentication token provided */ InvalidAuthenticationTokenProvided, - /** Note was too long */ NoteWasTooLong, - /** Provided too few or too many messages to delete. Must provide at least 2 and fewer than 100 messages to delete */ ProvidedTooFewOrTooManyMessagesToDeleteMustProvideAtLeast2AndFewerThan100MessagesToDelete, - /** A message can only be pinned to the channel it was sent in */ AMessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019, - /** Invite code was either invalid or taken */ InviteCodeWasEitherInvalidOrTaken, - /** Cannot execute action on a system message */ CannotExecuteActionOnASystemMessage, - /** Cannot execute action on this channel type */ CannotExecuteActionOnThisChannelType = 50024, - /** Invalid OAuth2 access token provided */ InvalidOAuth2AccessTokenProvided, - /** Missing required OAuth2 scope */ MissingRequiredOAuth2Scope, - /** Invalid webhook token provided */ InvalidWebhookTokenProvided, - /** Invalid role */ InvalidRole, - /** Invalid Recipient(s) */ InvalidRecipients = 50033, - /** A message provided was too old to bulk delete */ AMessageProvidedWasTooOldToBulkDelete, /** Invalid form body (returned for both `application/json` and `multipart/form-data` bodies), or invalid `Content-Type` provided */ InvalidFormBodyOrContentTypeProvided, - /** An invite was accepted to a guild the application's bot is not in */ AnInviteWasAcceptedToAGuildTheApplicationsBotIsNotIn, - /** Invalid API version provided */ InvalidApiVersionProvided = 50041, - /** File uploaded exceeds the maximum size */ FileUploadedExceedsTheMaximumSize = 50045, - /** Invalid file uploaded */ InvalidFileUploaded, - /** Cannot self-redeem this gift */ CannotSelfRedeemThisGift = 50054, - /** Invalid Guild */ InvalidGuild, - /** Payment source required to redeem gift */ PaymentSourceRequiredToRedeemGift = 50070, - /** Cannot delete a channel required for Community guilds */ CannotDeleteAChannelRequiredForCommunityGuilds = 50074, - /** Invalid sticker sent */ InvalidStickerSent = 50081, - /** Tried to perform an operation on an archived thread, such as editing a message or adding a user to the thread */ TriedToPerformAnOperationOnAnArchivedThreadSuchAsEditingAMessageOrAddingAUserToTheThread = 50083, - /** Invalid thread notification settings */ InvalidThreadNotificationSettings, - /** `before` value is earlier than the thread creation date */ BeforeValueIsEarlierThanTheThreadCreationDate, - /** This server is not available in your location */ ThisServerIsNotAvailableInYourLocation = 50095, - /** This server needs monetization enabled in order to perform this action */ ThisServerNeedsMonetizationEnabledInOrderToPerformThisAction = 50097, - /** This server needs more boosts to perform this action */ ThisServerNeedsMoreBoostsToPerformThisAction = 50101, - /** The request body contains invalid JSON. */ TheRequestBodyContainsInvalidJSON = 50109, TwoFactorIsRequiredForThisOperation = 60003, - /** No users with DiscordTag exist */ NoUsersWithDiscordTagExist = 80004, - /** Reaction was blocked */ ReactionWasBlocked = 90001, - /** API resource is currently overloaded. Try again a little later */ ApiResourceIsCurrentlyOverloadedTryAgainALittleLater = 130000, - /** The Stage is already open */ TheStageIsAlreadyOpen = 150006, - /** Cannot reply without permission to read message history */ CannotReplyWithoutPermissionToReadMessageHistory = 160002, - /** A thread has already been created for this message */ AThreadHasAlreadyBeenCreatedForThisMessage = 160004, - /** Thread is locked */ ThreadIsLocked = 160005, - /** Maximum number of active threads reached */ MaximumNumberOfActiveThreadsReached = 160006, - /** Maximum number of active announcement threads reached */ MaximumNumberOfActiveAnnouncementThreadsReached = 160007, - /** Invalid JSON for uploaded Lottie file */ InvalidJsonForUploadedLottieFile = 170001, - /** Uploaded Lotties cannot contain rasterized images such as PNG or JPEG */ UploadedLottiesCannotContainRasterizedImagesSuchAsPngOrJpeg, - /** Sticker maximum framerate exceeded */ StickerMaximumFramerateExceeded, - /** Sticker frame count exceeds maximum of 1000 frames */ StickerFrameCountExceedsMaximumOf1000Frames, - /** Lottie animation maximum dimensions exceeded */ LottieAnimationMaximumDimensionsExceeded, - /** Sticker frame rate is either too small or too large */ StickerFrameRateIsEitherTooSmallOrTooLarge, - /** Sticker animation duration exceeds maximum of 5 seconds */ StickerAnimationDurationExceedsMaximumOf5Seconds, - /** Cannot update a finished event */ CannotUpdateAFinishedEvent = 180000, - /** Failed to create stage needed for stage event */ FailedToCreateStageNeededForStageEvent = 180002, }