This commit is contained in:
Skillz
2020-02-09 13:59:45 -05:00
2 changed files with 128 additions and 2 deletions
+2 -2
View File
@@ -40,8 +40,8 @@
/* Module Resolution Options */
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
// Hack to stop VSCode from suggesting imports without ./ or ../ as a prefix.
"baseUrl": "../../", /* Base directory to resolve non-absolute module names. */
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */
// "types": [], /* Type declaration files to be included in compilation. */
+126
View File
@@ -28,3 +28,129 @@ export interface DiscordBotGateway {
export interface DiscordHeartbeatPayload {
heartbeat_interval: number
}
export enum GatewayOpcode {
Dispatch = 0,
Heartbeat,
Identify,
StatusUpdate,
VoiceStateUpdate,
Resume,
Reconnect,
RequestGuildMembers,
InvalidSession,
Hello,
HeartbeatACK
}
export enum GatewayCloseEventCode {
UnknownError = 4000,
UnknownOpcode,
DecodeError,
NotAuthenticated,
AuthenticationFailed,
AlreadyAuthenticated,
InvalidSeq = 4007,
RateLimited,
SessionTimeout,
InvalidShard,
ShardingRequired
}
export enum VoiceOpcode {
Identify,
SelectProtocol,
Ready,
Heartbeat,
SessionDescription,
Speaking,
HeartbeatACK,
Resume,
Hello,
Resumed,
ClientDisconnect = 13
}
export enum VoiceCloseEventCode {
UnknownOpcode = 4001,
NotAuthenticated = 4003,
AuthenticationFailed,
AlreadyAuthenticated,
SessionNoLongerValid,
SessionTimeout = 4009,
ServerNotFound = 4011,
UnknownProtocol,
Disconnected = 4014,
VoiceServerCrashed,
UnknownEncryptionMode
}
export enum HttpResponseCode {
Ok = 200,
Created,
NoContent = 204,
NotModified = 304,
BadRequest = 400,
Unauthorized = 401,
Forbidden = 403,
NotFound,
MethodNotAllowed,
TooManyRequests = 429,
GatewayUnavailable = 502,
// ServerError left untyped because it's 5xx.
}
export enum JSONErrorCode {
UnknownAccount = 10001,
UnknownApplication,
UnknownChannel,
UnknownGuild,
UnknownIntegration,
UnknownInvite,
UnknownMember,
UnknownMessge,
UnknownOverwrite,
UnknownProvider,
UnknownRole,
UnknownToken = 10012,
UnknownUser,
UnknownEmoji,
UnknownWebhook,
BotsCannotUse = 20001,
OnlyBotsCanUse,
MaxGuildsReached = 30001,
MaxFriendsReached,
MaxPinsReached,
MaxGuildRolesReached = 30005,
MaxReactionsReached = 30010,
MaxGuildChannelsReached = 30013,
MaxInvitesReached = 30016,
Unathorized = 40001,
UserIsBannedFromGuild = 40007,
MissingAccess = 50001,
InvalidAccountType = 50002,
CannotExecuteOnDMChannel,
WidgetDisabled,
CannotEditMessageByAnotherUser,
CannotSendEmptyMessage,
CannotSendMessageToUser,
CannotSendMessageInVoiceChannel,
ChannelVerificationTooHigh,
OAuth2ApplicationNoBot,
OAuth2ApplicationLimitReached,
InvalidOAuthState,
MissingPermissions,
InvalidAuthenticationToken,
NoteIsTooLong,
TooFewOrTooManyMessagesToDelete,
MessageCanOnlyBePinnedInParentChannel = 50019,
InviteCodeTakenOrInvalid,
CannotExecuteOnSystemMessage,
InvalidOAuth2AccessToken,
MessageProvidedTooOldToBulkDelet = 50034,
InvalidFormBody,
InviteAcceptedToGuildApplicationBotNotIn,
InvalidAPIVersion = 50041,
ReactionBlocked = 90001,
ResourceOverloaded = 130000
}