🐛 convert bigint -> string
This commit is contained in:
parent
641af37d5a
commit
bee6f71298
@ -1,6 +1,6 @@
|
|||||||
import { Config, listenEvent, emitEvent, RateLimit } from "@fosscord/util";
|
import { Config, listenEvent, emitEvent, RateLimit } from "@fosscord/util";
|
||||||
import { NextFunction, Request, Response, Router } from "express";
|
import { NextFunction, Request, Response, Router } from "express";
|
||||||
import { LessThan } from "typeorm";
|
import { LessThan, MoreThan } from "typeorm";
|
||||||
import { getIpAdress } from "../util/ipAddress";
|
import { getIpAdress } from "../util/ipAddress";
|
||||||
import { API_PREFIX_TRAILING_SLASH } from "./Authentication";
|
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);
|
Cache.set(event.channel_id as string, event.data);
|
||||||
event.acknowledge?.();
|
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 });
|
const limits = await RateLimit.find({ blocked: true });
|
||||||
limits.forEach((limit) => {
|
limits.forEach((limit) => {
|
||||||
Cache.set(limit.executor_id, limit);
|
Cache.set(limit.executor_id, limit);
|
||||||
|
@ -77,7 +77,7 @@ router.get("/", async (req: Request, res: Response) => {
|
|||||||
delete x.user_ids;
|
delete x.user_ids;
|
||||||
});
|
});
|
||||||
// @ts-ignore
|
// @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;
|
return x;
|
||||||
});
|
});
|
||||||
|
@ -47,7 +47,7 @@ router.post("/", check(GuildCreateSchema), async (req: Request, res: Response) =
|
|||||||
premium_tier: 0,
|
premium_tier: 0,
|
||||||
public_updates_channel_id: undefined,
|
public_updates_channel_id: undefined,
|
||||||
rules_channel_id: undefined,
|
rules_channel_id: undefined,
|
||||||
system_channel_flags: 0,
|
system_channel_flags: "0",
|
||||||
system_channel_id: undefined,
|
system_channel_id: undefined,
|
||||||
unavailable: false,
|
unavailable: false,
|
||||||
vanity_url_code: undefined,
|
vanity_url_code: undefined,
|
||||||
|
@ -33,7 +33,7 @@ export const GuildUpdateSchema = {
|
|||||||
$icon: String,
|
$icon: String,
|
||||||
$verification_level: Number,
|
$verification_level: Number,
|
||||||
$default_message_notifications: Number,
|
$default_message_notifications: Number,
|
||||||
$system_channel_flags: Number,
|
$system_channel_flags: String,
|
||||||
$system_channel_id: String,
|
$system_channel_id: String,
|
||||||
$explicit_content_filter: Number,
|
$explicit_content_filter: Number,
|
||||||
$public_updates_channel_id: String,
|
$public_updates_channel_id: String,
|
||||||
|
Binary file not shown.
@ -42,7 +42,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const members = await Member.find({ where: { id: this.user_id }, relations: ["guilds"] });
|
const members = await Member.find({ where: { id: this.user_id }, relations: ["guild"] });
|
||||||
const merged_members = members.map((x: any) => {
|
const merged_members = members.map((x: any) => {
|
||||||
const y = { ...x, user_id: x.id };
|
const y = { ...x, user_id: x.id };
|
||||||
delete y.settings;
|
delete y.settings;
|
||||||
|
@ -39,7 +39,7 @@ export const ActivitySchema = {
|
|||||||
$match: String,
|
$match: String,
|
||||||
},
|
},
|
||||||
$instance: Boolean,
|
$instance: Boolean,
|
||||||
$flags: BigInt,
|
$flags: String,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
$since: Number, // unix time (in milliseconds) of when the client went idle, or null if the client is not idle
|
$since: Number, // unix time (in milliseconds) of when the client went idle, or null if the client is not idle
|
||||||
@ -79,7 +79,7 @@ export interface ActivitySchema {
|
|||||||
match?: string; // the secret for a specific instanced match
|
match?: string; // the secret for a specific instanced match
|
||||||
};
|
};
|
||||||
instance?: boolean;
|
instance?: boolean;
|
||||||
flags: bigint; // activity flags OR d together, describes what the payload includes
|
flags: string; // activity flags OR d together, describes what the payload includes
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
since?: number; // unix time (in milliseconds) of when the client went idle, or null if the client is not idle
|
since?: number; // unix time (in milliseconds) of when the client went idle, or null if the client is not idle
|
||||||
|
@ -62,7 +62,7 @@ export class Application extends BaseClass {
|
|||||||
cover_image?: string; // the application's default rich presence invite cover image hash
|
cover_image?: string; // the application's default rich presence invite cover image hash
|
||||||
|
|
||||||
@Column()
|
@Column()
|
||||||
flags: number; // the application's public flags
|
flags: string; // the application's public flags
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ApplicationCommand {
|
export interface ApplicationCommand {
|
||||||
|
@ -36,7 +36,7 @@ export interface ReadyEventData {
|
|||||||
mobile: boolean;
|
mobile: boolean;
|
||||||
desktop: boolean;
|
desktop: boolean;
|
||||||
email: string | undefined;
|
email: string | undefined;
|
||||||
flags: bigint;
|
flags: string;
|
||||||
mfa_enabled: boolean;
|
mfa_enabled: boolean;
|
||||||
nsfw_allowed: boolean;
|
nsfw_allowed: boolean;
|
||||||
phone: string | undefined;
|
phone: string | undefined;
|
||||||
@ -85,7 +85,7 @@ export interface ReadyEventData {
|
|||||||
};
|
};
|
||||||
application?: {
|
application?: {
|
||||||
id: string;
|
id: string;
|
||||||
flags: bigint;
|
flags: string;
|
||||||
};
|
};
|
||||||
merged_members?: Omit<Member, "settings" | "user">[][];
|
merged_members?: Omit<Member, "settings" | "user">[][];
|
||||||
// probably all users who the user is in contact with
|
// probably all users who the user is in contact with
|
||||||
@ -95,7 +95,7 @@ export interface ReadyEventData {
|
|||||||
id: string;
|
id: string;
|
||||||
username: string;
|
username: string;
|
||||||
bot: boolean;
|
bot: boolean;
|
||||||
public_flags: bigint;
|
public_flags: string;
|
||||||
}[];
|
}[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user