diff --git a/.gitignore b/.gitignore index 67045665..5c7cd31d 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,4 @@ dist # TernJS port file .tern-port +.DS_Store \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 62ab65ac..6ab37be3 100644 Binary files a/package-lock.json and b/package-lock.json differ diff --git a/package.json b/package.json index 4573e81a..5ed99733 100644 --- a/package.json +++ b/package.json @@ -1,22 +1,28 @@ { - "name": "websocket_learn", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC", - "dependencies": { - "lambert-db": "^1.1.2", - "node-fetch": "^2.6.1", - "uuid": "^8.3.2", - "ws": "^7.4.2" - }, - "devDependencies": { - "@types/uuid": "^8.3.0", - "@types/ws": "^7.4.0" - } + "name": "discord-gateway", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "tsc -b .", + "start": "npm run build && node dist/" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "discord-server-util": "git+https://github.com/discord-open-source/discord-server-util.git", + "erlpack": "^0.1.3", + "jsonwebtoken": "^8.5.1", + "lambert-db": "^1.1.2", + "node-fetch": "^2.6.1", + "uuid": "^8.3.2", + "ws": "^7.4.2" + }, + "devDependencies": { + "@types/jsonwebtoken": "^8.5.0", + "@types/uuid": "^8.3.0", + "@types/ws": "^7.4.0" + } } diff --git a/src/assets/codes.ts b/src/assets/codes.ts deleted file mode 100644 index 5b9a5546..00000000 --- a/src/assets/codes.ts +++ /dev/null @@ -1,31 +0,0 @@ -export enum OPCODES { - Dispatch, - Heartbeat, - Identify, - Presence_Update, - Voice_State_Update, - Resume, - Reconnect, - Request_Guild_Members, - Invalid_Session, - Hello, - Heartbeat_ACK, -} -export enum CLOSECODES { - Unknown_error = 4000, - Unknown_opcode, - Decode_error, - Not_authenticated, - Authentication_failed, - Already_authenticated, - Invalid_session, - Invalid_seq, - Rate_limited, - Session_timed_out, - Invalid_shard, - Sharding_required, - Invalid_API_version, - Invalid_intent, - Disallowed_intent, -} -export enum SEQUENCENUM {} diff --git a/src/assets/datastru.ts b/src/assets/datastru.ts deleted file mode 100644 index 038102ec..00000000 --- a/src/assets/datastru.ts +++ /dev/null @@ -1,15 +0,0 @@ -//* https://discord.com/developers/docs/topics/gateway - -import { OPCODES, SEQUENCENUM } from "./codes"; - -export interface message_prod { - op: OPCODES; - d: object; - s: SEQUENCENUM; - t: string; -} - -export interface message_dev { - req_type: "new_auth" | "check_auth"; - token?: string; -}