Added rpc files

This commit is contained in:
Toastie 2024-09-12 18:46:04 +12:00
parent 83efa2c6e8
commit bb7571f6b8
Signed by: toastie_t0ast
GPG key ID: 27F3B6855AFD40A4
3 changed files with 38 additions and 0 deletions

33
rpc/common.ts Normal file
View file

@ -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,
}

4
rpc/index.ts Normal file
View file

@ -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';

1
rpc/v9.ts Normal file
View file

@ -0,0 +1 @@
export * from './common';