mirror of
https://github.com/spacebarchat/server.git
synced 2026-05-24 21:15:28 +00:00
🐛 fix Event Emitter
This commit is contained in:
+5
-5
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
+1
-1
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user