From 7fd08a6555ee215184bdd734f3c6f474a7ff27c4 Mon Sep 17 00:00:00 2001 From: Caleb Denio Date: Mon, 28 Dec 2020 13:22:27 -0500 Subject: [PATCH] :bug: Limit leaderboard to 10 entries --- pkg/jia/handlers.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/jia/handlers.go b/pkg/jia/handlers.go index 28f4fd8..2b9d435 100644 --- a/pkg/jia/handlers.go +++ b/pkg/jia/handlers.go @@ -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),