From ee87b470f3bdbcfd0f287c6361d93982bb57c52c Mon Sep 17 00:00:00 2001 From: mezotv Date: Sun, 22 Sep 2024 02:23:07 +0000 Subject: [PATCH] chore(style): format files --- src/buttons/pagination/paginateLast.ts | 27 ++++++++++++++----------- src/buttons/pagination/paginateNext.ts | 28 +++++++++++++++----------- 2 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/buttons/pagination/paginateLast.ts b/src/buttons/pagination/paginateLast.ts index 56c1da4c..a5949094 100644 --- a/src/buttons/pagination/paginateLast.ts +++ b/src/buttons/pagination/paginateLast.ts @@ -126,18 +126,21 @@ const button: Button = { ); } else { data = await Promise.all( - guildDb.gameScores.sort((a: any, b: any) => b.higherlower - a.higherlower).slice((paginate.pages.length - 1) * 10).map(async (u: any) => { - const user = await client.database.getUser(u.userID, true); - return user?.votePrivacy - ? { - user: "Anonymous", - score: u.higherlower, - } - : { - user: u.userID, - score: u.higherlower, - }; - }), + guildDb.gameScores + .sort((a: any, b: any) => b.higherlower - a.higherlower) + .slice((paginate.pages.length - 1) * 10) + .map(async (u: any) => { + const user = await client.database.getUser(u.userID, true); + return user?.votePrivacy + ? { + user: "Anonymous", + score: u.higherlower, + } + : { + user: u.userID, + score: u.higherlower, + }; + }), ); } diff --git a/src/buttons/pagination/paginateNext.ts b/src/buttons/pagination/paginateNext.ts index 7d0827d2..4c652066 100644 --- a/src/buttons/pagination/paginateNext.ts +++ b/src/buttons/pagination/paginateNext.ts @@ -124,18 +124,22 @@ const button: Button = { ); } else { data = await Promise.all( - guildDb.gameScores.sort((a: any, b: any) => b.higherlower - a.higherlower).slice(paginate.page * 10).map(async (u: any) => { // , paginate.page * 10 + 10 - const user = await client.database.getUser(u.userID, true); - return user?.votePrivacy - ? { - user: "Anonymous", - score: u.higherlower, - } - : { - user: u.userID, - score: u.higherlower, - }; - }), + guildDb.gameScores + .sort((a: any, b: any) => b.higherlower - a.higherlower) + .slice(paginate.page * 10) + .map(async (u: any) => { + // , paginate.page * 10 + 10 + const user = await client.database.getUser(u.userID, true); + return user?.votePrivacy + ? { + user: "Anonymous", + score: u.higherlower, + } + : { + user: u.userID, + score: u.higherlower, + }; + }), ); }