Skip to content

Commit 14bf8f8

Browse files
authored
Merge pull request #121 from tjjfvi/no-bot-rep
Exclude bot user from !lb
2 parents f828a7f + df06d2f commit 14bf8f8

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/modules/rep.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,14 @@ export class RepModule extends Module {
165165
.select(['give.to', 'COUNT(*)'])
166166
.groupBy('give.to')
167167
.orderBy('COUNT(*)', 'DESC')
168-
.limit(10)
169-
.getRawMany()) as { toId: string; count: string }[]).map(x => ({
170-
id: x.toId,
171-
count: parseInt(x.count, 10),
172-
}));
168+
.limit(11)
169+
.getRawMany()) as { toId: string; count: string }[])
170+
.filter(x => x.toId !== this.client.user?.id)
171+
.slice(0, 10)
172+
.map(x => ({
173+
id: x.toId,
174+
count: parseInt(x.count, 10),
175+
}));
173176
const embed = new MessageEmbed()
174177
.setColor(TS_BLUE)
175178
.setTitle('Top 10 Reputation')

0 commit comments

Comments
 (0)