From bb7571f6b81db63dd8b9b64ca67162bdf092b98f Mon Sep 17 00:00:00 2001 From: Toastie Date: Thu, 12 Sep 2024 18:46:04 +1200 Subject: [PATCH] Added rpc files --- rpc/common.ts | 33 +++++++++++++++++++++++++++++++++ rpc/index.ts | 4 ++++ rpc/v9.ts | 1 + 3 files changed, 38 insertions(+) create mode 100644 rpc/common.ts create mode 100644 rpc/index.ts create mode 100644 rpc/v9.ts diff --git a/rpc/common.ts b/rpc/common.ts new file mode 100644 index 0000000..8e4dc2a --- /dev/null +++ b/rpc/common.ts @@ -0,0 +1,33 @@ +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes + */ +export enum RPCErrorCodes { + UnknownError = 1000, + InvalidPayload = 4000, + InvalidCommand = 4002, + InvalidGuild, + InvalidEvent, + InvalidChannel, + InvalidPermissions, + InvalidClientId, + InvalidOrigin, + InvalidToken, + InvalidUser, + OAuth2Error = 5000, + SelectChannelTimedOut, + GetGuildTimedOut, + SelectVoiceForceRequired, + CaptureShortcutAlreadyListening, +} + +/** + * https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-close-event-codes + */ +export enum RPCCloseEventCodes { + InvalidClientId = 4000, + InvalidOrigin, + RateLimited, + TokenRevoked, + InvalidVersion, + InvalidEncoding, +} \ No newline at end of file diff --git a/rpc/index.ts b/rpc/index.ts new file mode 100644 index 0000000..1dab6c2 --- /dev/null +++ b/rpc/index.ts @@ -0,0 +1,4 @@ +// This file exports all the types available in the recommended API version +// Thereby, things MAY break in the future. Try sticking to imports from a specific version + +export * from './v9'; \ No newline at end of file diff --git a/rpc/v9.ts b/rpc/v9.ts new file mode 100644 index 0000000..a18f847 --- /dev/null +++ b/rpc/v9.ts @@ -0,0 +1 @@ +export * from './common'; \ No newline at end of file