🐛 convert bigint -> string

This commit is contained in:
Flam3rboy
2021-08-29 17:12:46 +02:00
parent 641af37d5a
commit bee6f71298
9 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import { Config, listenEvent, emitEvent, RateLimit } from "@fosscord/util";
import { NextFunction, Request, Response, Router } from "express";
import { LessThan } from "typeorm";
import { LessThan, MoreThan } from "typeorm";
import { getIpAdress } from "../util/ipAddress";
import { API_PREFIX_TRAILING_SLASH } from "./Authentication";
@@ -100,7 +100,7 @@ export async function initRateLimits(app: Router) {
Cache.set(event.channel_id as string, event.data);
event.acknowledge?.();
});
await RateLimit.delete({ expires_at: LessThan(new Date()) }); // clean up if not already deleted
await RateLimit.delete({ expires_at: MoreThan(new Date()) }); // cleans up if not already deleted, morethan -> older date
const limits = await RateLimit.find({ blocked: true });
limits.forEach((limit) => {
Cache.set(limit.executor_id, limit);
@@ -77,7 +77,7 @@ router.get("/", async (req: Request, res: Response) => {
delete x.user_ids;
});
// @ts-ignore
if (!x.author) x.author = { discriminator: "0000", username: "Deleted User", public_flags: 0n, avatar: null };
if (!x.author) x.author = { discriminator: "0000", username: "Deleted User", public_flags: "0", avatar: null };
return x;
});
+1 -1
View File
@@ -47,7 +47,7 @@ router.post("/", check(GuildCreateSchema), async (req: Request, res: Response) =
premium_tier: 0,
public_updates_channel_id: undefined,
rules_channel_id: undefined,
system_channel_flags: 0,
system_channel_flags: "0",
system_channel_id: undefined,
unavailable: false,
vanity_url_code: undefined,
+1 -1
View File
@@ -33,7 +33,7 @@ export const GuildUpdateSchema = {
$icon: String,
$verification_level: Number,
$default_message_notifications: Number,
$system_channel_flags: Number,
$system_channel_flags: String,
$system_channel_id: String,
$explicit_content_filter: Number,
$public_updates_channel_id: String,