mirror of
https://github.com/cjdenio/jia.git
synced 2024-11-21 23:23:39 +00:00
🐛 Limit leaderboard to 10 entries
This commit is contained in:
parent
ed06d3145d
commit
7fd08a6555
1 changed files with 4 additions and 0 deletions
|
@ -135,6 +135,10 @@ func HandleLeaderboardSlashCommand(w http.ResponseWriter, r *http.Request) {
|
|||
return entries[i].Number > entries[j].Number
|
||||
})
|
||||
|
||||
if len(entries) > 10 {
|
||||
entries = entries[:10]
|
||||
}
|
||||
|
||||
blocks := []slack.Block{
|
||||
slack.NewSectionBlock(
|
||||
slack.NewTextBlockObject("mrkdwn", fmt.Sprintf(":chart_with_upwards_trend: Counting stats for *%s %d*:", month.String(), year), false, false),
|
||||
|
|
Loading…
Reference in a new issue