summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Server.ts10
-rw-r--r--src/routes/test.ts14
-rw-r--r--src/util/Event.ts2
3 files changed, 20 insertions, 6 deletions
diff --git a/src/Server.ts b/src/Server.ts

index 18bd1c7a..0c92e1b7 100644 --- a/src/Server.ts +++ b/src/Server.ts
@@ -73,11 +73,11 @@ export class DiscordServer extends Server { this.app.use(ErrorHandler); const indexHTML = await fs.readFile(__dirname + "/../client_test/index.html"); - this.app.get("*", (req, res) => { - res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24); - res.set("content-type", "text/html"); - res.send(indexHTML); - }); + // this.app.get("*", (req, res) => { + // res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24); + // res.set("content-type", "text/html"); + // res.send(indexHTML); + // }); return super.start(); } } diff --git a/src/routes/test.ts b/src/routes/test.ts new file mode 100644
index 00000000..b488d6e4 --- /dev/null +++ b/src/routes/test.ts
@@ -0,0 +1,14 @@ +import { Router } from "express"; +import { getPermission, MemberModel, db } from "fosscord-server-util"; +import { Types } from "mongoose"; +const router: Router = Router(); + +router.get("/", async (req, res) => { + // @ts-ignore + const perm = await getPermission(813185668657184768n, 813189959920910336n); + console.log(perm); + if (perm.has("ADD_REACTIONS")) console.log("add"); + res.send("OK"); +}); + +export default router; diff --git a/src/util/Event.ts b/src/util/Event.ts
index c75c909f..39389cbb 100644 --- a/src/util/Event.ts +++ b/src/util/Event.ts
@@ -2,7 +2,7 @@ import { Event, EventModel } from "fosscord-server-util"; export async function emitEvent(payload: Omit<Event, "created_at">) { const emitEvent = { - created_at: Math.floor(Date.now() / 1000), // in seconds + created_at: new Date(), // in seconds ...payload, };