Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/modules/rep.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export class RepModule extends Module {
description: 'See who has the most reputation',
})
async leaderboard(msg: Message) {
const topEmojis = [':first_place:', ':second_place:', ':third_place:'];
const data = ((await RepGive.createQueryBuilder('give')
.select(['give.to', 'COUNT(*)'])
.groupBy('give.to')
Expand All @@ -173,8 +174,10 @@ export class RepModule extends Module {
.setDescription(
data
.map(
x =>
`:white_small_square: **<@${x.id}>** with **${x.count}** points.`,
(x, index) =>
`${
topEmojis[index] || ':small_white_square:'
} **<@${x.id}>** with **${x.count}** points.`,
)
.join('\n'),
);
Expand Down