Skip to content

Commit

Permalink
Merge formatting
Browse files Browse the repository at this point in the history
Merge formatting into main
  • Loading branch information
github-actions[bot] authored Sep 22, 2024
2 parents 72bf20f + ee87b47 commit 46aeb83
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 24 deletions.
27 changes: 15 additions & 12 deletions src/buttons/pagination/paginateLast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}),
);
}

Expand Down
28 changes: 16 additions & 12 deletions src/buttons/pagination/paginateNext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}),
);
}

Expand Down

0 comments on commit 46aeb83

Please sign in to comment.