Announce a contributor program in #leaderboard when it starts

Open
#153 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
74/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
nodejs, typescript
Domain
backend

Research direction

Start in src/index.ts at dailyPosts (line 463) and read the final-results path (lines 487-511) to copy its started:<id> KV mark, retry-on-failure and one-week window. Add programStartMessage(program, { url }) to src/messages.ts beside leaderboardMessage (line 136), reusing dateRange from src/page.ts (line 17). Drive it with the scheduled tests in test/index.test.ts (line 262), calling worker.scheduled at 2026-12-01T04:30:00Z and 2026-12-02T04:30:00Z and asserting on fetched.discord(); done is all acceptance boxes checked and npm run typecheck plus npm test green.

Written by the indexing model from the issue text.

Description

enhancement help wanted

There's a new program every month now, but nothing in Discord says when one starts. The daily run (dailyPosts, src/index.ts, line 463) posts a running program's board on Mondays (line 478) and its final results once it ends (line 487). December starts on a Tuesday, so the first time #leaderboard mentions it will be the weekly board on December 7.

A short post on the first run after a program starts would tell people the new month is on, right after the old month's final results, while they're paying attention.

What to do

  • Add a message builder to src/messages.ts, for example programStartMessage(program, { url }), with no I/O like the others. It should give the title, the dates (dateRange in src/page.ts, line 17, already writes "Dec 1 to Dec 31, 2026 (UTC)"), what counts (the label and the repos), the minimum, how many people win what, the note if there is one, a link to the program page, and a pointer to /issues. It must not ping anyone.
  • In dailyPosts, send it to CHANNEL_LEADERBOARD once per program, on the first run after start. Copy how the final results do it (lines 487 to 511): a started:<id> mark in KV so it goes out once, another try on the next run if sending fails, and only within a week of the start, so adding an older program to the config doesn't announce it.
  • When a program starts on a Monday, send the start post instead of that day's weekly board, which would be empty anyway.
  • Mention it in the daily cron row of the "How it works" table in README.md.

Where to look

  • src/index.ts: dailyPosts (line 463)
  • src/messages.ts: leaderboardMessage (line 136), for how the footer and the page link are written
  • test/index.test.ts: the "scheduled leaderboard" tests (line 262)

Acceptance criteria

  • On the first daily run in a program's first week, one start post goes to the leaderboard channel, and none on later runs
  • If sending fails, it's tried again on the next run
  • A program whose start was more than a week ago is never announced
  • A program that starts on a Monday gets the start post and no weekly board that day
  • On December 1 the order is November's final results, then December's start post
  • Tests for these cases
  • npm run typecheck and npm test pass

How to test

The scheduled tests call worker.scheduled at a given time, so you can run, for example, 2026-12-01T04:30:00Z and 2026-12-02T04:30:00Z with a November and a December program and check what fetched.discord() holds after each. Some existing tests run inside a program's first week and will now see the extra post: "handles several programs, each on its own" (line 345) runs on November 2 with a November program. Update their expectations, or set the started: mark in KV where a test isn't about the start post.


Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off develop, and open your PR against develop with Closes #153 in the description.

Dominant language
TypeScript
Stars
0
Forks
1
Avg merge
2h 38m
Merged PRs (30d)
73

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from codercops/discord-bot

All issues in codercops/discord-bot

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.