Skip to content

Commit d0c7e27

Browse files
committed
Also add list of usernames for sock-board
1 parent c202847 commit d0c7e27

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/bot.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,8 @@ app.command("/sock-board", async ({ ack, body, client, logger }) => {
507507
const leaderboardRows = await sql`SELECT
508508
c.id AS clan_id,
509509
c.name AS clan_name,
510-
COALESCE(SUM((project->>'total')::int), 0) AS total_seconds_coded
510+
COALESCE(SUM((project->>'total')::int), 0) AS total_seconds_coded,
511+
jsonb_agg(distinct u.username) AS usernames
511512
FROM
512513
clans c
513514
LEFT JOIN
@@ -528,9 +529,11 @@ app.command("/sock-board", async ({ ack, body, client, logger }) => {
528529
(
529530
{
530531
clan_name,
532+
usernames,
531533
total_seconds_coded,
532534
}: {
533535
clan_name: string;
536+
usernames: string[];
534537
total_seconds_coded: number;
535538
},
536539
idx: number,
@@ -544,7 +547,7 @@ app.command("/sock-board", async ({ ack, body, client, logger }) => {
544547
? ":third_place_medal:"
545548
: "";
546549

547-
return `${medal} ${clan_name}: ${(total_seconds_coded / 60 / 60).toFixed(1)} hours`;
550+
return `${medal} ${clan_name}: ${(total_seconds_coded / 60 / 60).toFixed(1)} hours (\`${usernames}\`)`;
548551
},
549552
);
550553

0 commit comments

Comments
 (0)