Announce a contributor program in #leaderboard when it starts

Đang mở
#153 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
74/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
nodejs, typescript
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
0
Fork
1
Merge trung bình
2 giờ 38 phút
Pull request đã merge (30 ngày)
73

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codercops/discord-bot

Tất cả issue của codercops/discord-bot

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.