🎨 create start.ts
This commit is contained in:
parent
3b9e4a23c5
commit
e12197d568
@ -10,4 +10,4 @@ RUN apk del build-dependencies
|
|||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
EXPOSE 3002
|
EXPOSE 3002
|
||||||
CMD ["node", "dist/"]
|
CMD ["node", "dist/start.js"]
|
@ -2,12 +2,12 @@
|
|||||||
"name": "@fosscord/gateway",
|
"name": "@fosscord/gateway",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"start": "npm run build && node dist/",
|
"start": "npm run build && node dist/start.js",
|
||||||
"build": "npx tsc -b .",
|
"build": "npx tsc -b .",
|
||||||
"dev": "tsnd --respawn src/index.ts"
|
"dev": "tsnd --respawn src/start.ts"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "Fosscord",
|
"author": "Fosscord",
|
||||||
|
10
src/index.ts
10
src/index.ts
@ -1,9 +1 @@
|
|||||||
process.on("uncaughtException", console.error);
|
export * from "./Server";
|
||||||
process.on("unhandledRejection", console.error);
|
|
||||||
|
|
||||||
import { Server } from "./Server";
|
|
||||||
import { config } from "dotenv";
|
|
||||||
config();
|
|
||||||
|
|
||||||
const server = new Server();
|
|
||||||
server.listen();
|
|
||||||
|
@ -62,7 +62,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
|||||||
}) as MemberDocument[][];
|
}) as MemberDocument[][];
|
||||||
const user_guild_settings_entries = members.map((x) => x.settings);
|
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();
|
const user = await UserModel.findOne({ id: this.user_id }).exec();
|
||||||
if (!user) return this.close(CLOSECODES.Authentication_failed);
|
if (!user) return this.close(CLOSECODES.Authentication_failed);
|
||||||
|
|
||||||
|
9
src/start.ts
Normal file
9
src/start.ts
Normal file
@ -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();
|
Loading…
x
Reference in New Issue
Block a user