Skip to content

Commit f535fca

Browse files
authored
Merge pull request #92 from shngt/lb-icons
Added emojis to leaderboard
2 parents deecd98 + 7cc324a commit f535fca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/modules/rep.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ export class RepModule extends Module {
158158
description: 'See who has the most reputation',
159159
})
160160
async leaderboard(msg: Message) {
161+
const topEmojis = [':first_place:', ':second_place:', ':third_place:'];
161162
const data = ((await RepGive.createQueryBuilder('give')
162163
.select(['give.to', 'COUNT(*)'])
163164
.groupBy('give.to')
@@ -173,8 +174,10 @@ export class RepModule extends Module {
173174
.setDescription(
174175
data
175176
.map(
176-
x =>
177-
`:white_small_square: **<@${x.id}>** with **${x.count}** points.`,
177+
(x, index) =>
178+
`${
179+
topEmojis[index] || ':small_white_square:'
180+
} **<@${x.id}>** with **${x.count}** points.`,
178181
)
179182
.join('\n'),
180183
);

0 commit comments

Comments
 (0)