Skip to content

Commit

Permalink
feat: rpc types
Browse files Browse the repository at this point in the history
Co-authored-by: Danial Raza <[email protected]>
  • Loading branch information
OfficialSirH and sdanialraza committed Jan 26, 2025
1 parent 8fe9c07 commit c093891
Show file tree
Hide file tree
Showing 4 changed files with 1,454 additions and 2 deletions.
94 changes: 93 additions & 1 deletion deno/rpc/common.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
/**
* @unstable
*/
export enum LobbyType {
Private = 1,
Public,
}

/**
* @unstable
*/
export enum RelationshipType {
None,
Friend,
Blocked,
PendingIncoming,
PendingOutgoing,
Implicit,
}

/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes
*/
export enum RPCErrorCodes {
UnknownError = 1_000,
/**
* @unstable
*/
ServiceUnavailable,
/**
* @unstable
*/
TransactionAborted,
InvalidPayload = 4_000,
InvalidCommand = 4_002,
InvalidGuild,
Expand All @@ -13,21 +41,85 @@ export enum RPCErrorCodes {
InvalidOrigin,
InvalidToken,
InvalidUser,
/**
* @unstable
*/
InvalidInvite,
/**
* @unstable
*/
InvalidActivityJoinRequest,
/**
* @unstable
*/
InvalidLobby,
/**
* @unstable
*/
InvalidLobbySecret,
/**
* @unstable
*/
InvalidEntitlement,
/**
* @unstable
*/
InvalidGiftCode,
OAuth2Error = 5_000,
SelectChannelTimedOut,
GetGuildTimedOut,
SelectVoiceForceRequired,
CaptureShortcutAlreadyListening,
/**
* @unstable
*/
InvalidActivitySecret,
/**
* @unstable
*/
NoEligibleActivity,
/**
* @unstable
*/
LobbyFull,
/**
* @unstable
*/
PurchaseCanceled,
/**
* @unstable
*/
PurchaseError,
/**
* @unstable
*/
UnauthorizedForAchievement,
/**
* @unstable
*/
RateLimited,
}

/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-close-event-codes
*/
export enum RPCCloseEventCodes {
/**
* @unstable
*/
CloseNormal = 1_000,
/**
* @unstable
*/
CloseUnsupported = 1_003,
/**
* @unstable
*/
CloseAbnormal = 1_006,
InvalidClientId = 4_000,
InvalidOrigin,
RateLimited,
TokenRevoked,
InvalidVersion,
InvalidEncoding,
}
}
Loading

0 comments on commit c093891

Please sign in to comment.