From e12197d568d24d6fb942916c06e356d0ca39f611 Mon Sep 17 00:00:00 2001 From: Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> Date: Mon, 31 May 2021 00:51:54 +0200 Subject: :art: create start.ts --- src/index.ts | 10 +--------- src/opcodes/Identify.ts | 2 +- src/start.ts | 9 +++++++++ 3 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 src/start.ts (limited to 'src') diff --git a/src/index.ts b/src/index.ts index 2fe360e2..7513bd2f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1 @@ -process.on("uncaughtException", console.error); -process.on("unhandledRejection", console.error); - -import { Server } from "./Server"; -import { config } from "dotenv"; -config(); - -const server = new Server(); -server.listen(); +export * from "./Server"; diff --git a/src/opcodes/Identify.ts b/src/opcodes/Identify.ts index d21041cc..1a136dd3 100644 --- a/src/opcodes/Identify.ts +++ b/src/opcodes/Identify.ts @@ -62,7 +62,7 @@ export async function onIdentify(this: WebSocket, data: Payload) { }) as MemberDocument[][]; const user_guild_settings_entries = members.map((x) => x.settings); - const channels = await ChannelModel.find({ recipients: this.user_id }).exec(); + const channels = await ChannelModel.find({ recipient_ids: this.user_id }).exec(); const user = await UserModel.findOne({ id: this.user_id }).exec(); if (!user) return this.close(CLOSECODES.Authentication_failed); diff --git a/src/start.ts b/src/start.ts new file mode 100644 index 00000000..2fe360e2 --- /dev/null +++ b/src/start.ts @@ -0,0 +1,9 @@ +process.on("uncaughtException", console.error); +process.on("unhandledRejection", console.error); + +import { Server } from "./Server"; +import { config } from "dotenv"; +config(); + +const server = new Server(); +server.listen(); -- cgit 1.5.1