summary refs log tree commit diff
diff options
context:
space:
mode:
authorDiego Magdaleno <38844659+DiegoMagdaleno@users.noreply.github.com>2021-07-21 14:47:07 -0500
committerDiego Magdaleno <38844659+DiegoMagdaleno@users.noreply.github.com>2021-07-21 14:47:07 -0500
commita95d7b7ce5b6712f1eaec10ed9de6d39d72de3a7 (patch)
tree8728427ae45f63c0cee0be14587569c5de7264cf
parent[Gateway Endpoint] Encode response as JSON (diff)
downloadserver-a95d7b7ce5b6712f1eaec10ed9de6d39d72de3a7.tar.xz
[Fix] All messages should have edited_timestamp even if null
-rw-r--r--src/routes/channels/#channel_id/messages/index.ts2
-rw-r--r--src/routes/gateway.ts3
-rw-r--r--src/start.ts1
3 files changed, 3 insertions, 3 deletions
diff --git a/src/routes/channels/#channel_id/messages/index.ts b/src/routes/channels/#channel_id/messages/index.ts

index 053a2a02..4e42d546 100644 --- a/src/routes/channels/#channel_id/messages/index.ts +++ b/src/routes/channels/#channel_id/messages/index.ts
@@ -126,7 +126,7 @@ router.post("/", messageUpload.single("file"), async (req: Request, res: Respons const embeds = []; if (body.embed) embeds.push(body.embed); - const data = await sendMessage({ ...body, type: 0, pinned: false, author_id: req.user_id, embeds, channel_id, attachments }); + const data = await sendMessage({ ...body, type: 0, pinned: false, author_id: req.user_id, embeds, channel_id, attachments, edited_timestamp: null }); return res.send(data); }); diff --git a/src/routes/gateway.ts b/src/routes/gateway.ts
index 2ddd06d8..f2bc5b34 100644 --- a/src/routes/gateway.ts +++ b/src/routes/gateway.ts
@@ -5,8 +5,7 @@ const router = Router(); router.get("/", (req: Request, res: Response) => { const { endpoint } = Config.get().gateway; - res.setHeader('Content-Type', 'application/json'); - res.send(JSON.stringify({ url: endpoint || process.env.GATEWAY || "ws://localhost:3002" })); + res.json({ url: endpoint || process.env.GATEWAY || "ws://localhost:3002" }); }); export default router; diff --git a/src/start.ts b/src/start.ts
index d799c190..b2ba9e65 100644 --- a/src/start.ts +++ b/src/start.ts
@@ -5,6 +5,7 @@ import "missing-native-js-functions"; import { config } from "dotenv"; config(); import { FosscordServer } from "./Server"; +console.log(process.env.MONGO_URL) import cluster from "cluster"; import os from "os"; const cores = Number(process.env.threads) || os.cpus().length;