From c1b165024dfbbef90875721d65b4712ee4b5b340 Mon Sep 17 00:00:00 2001 From: Wroclaw Date: Wed, 10 May 2023 03:02:49 +0200 Subject: [PATCH] export getUserLimit will be used in a command that check the user limit --- src/execution.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/execution.ts b/src/execution.ts index e55e9b5..c66ad4f 100644 --- a/src/execution.ts +++ b/src/execution.ts @@ -28,13 +28,11 @@ export function getAuthor(request: apiRequest) { * @param requestTimestamp the timestamp of the user request * @returns object containing the limit and remaining usage or `false` if there is no limit */ -async function getUserLimit(user: string | {id: string}, requestTimestamp: Date) { +export async function getUserLimit(user: string | { id: string }, requestTimestamp: Date) { const userId: string = typeof user === "string" ? user : user.id; const userLimits = await database.limits.findUnique({ - where: { - user: BigInt(userId) - } + where: { user: BigInt(userId) } }); if (userLimits?.vip) return false;