simplify: use direct Discord API cron script - #8
Merged
Conversation
Run the blog and YouTube digests as a short-lived Python cron task instead of a persistent Discord bot. Remove Docker and unused background bot layers, and document the Sparked Host setup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d9ac8887-4080-4972-980e-45eabc93247b
Reduce the scheduled job to one Python entry point that fetches the configured blog and YouTube content and posts embeds through Discord's HTTP API. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d9ac8887-4080-4972-980e-45eabc93247b
Contributor
There was a problem hiding this comment.
Review details
Comments suppressed due to low confidence (4)
main.py:61
run_digestaborts on the first exception (e.g., blog fetch/post failure), so the YouTube digest will not be attempted. This contradicts the setup docs that say the process reports failure after attempting both sources, and it also reduces reliability (one source outage prevents the other digest from posting).
def run_digest(config: dict, token: str) -> None:
now = datetime.now(tz=timezone.utc)
since = now - timedelta(days=7)
blog = config["blog"]
main.py:94
- The YouTube branch should be isolated from failures in the blog branch, and vice-versa, so the job can attempt both digests and then fail if either one failed. Right now any YouTube exception (including YouTube API
HttpError) aborts immediately and prevents the job from recording a combined failure outcome.
youtube = config["youtube"]
videos = YouTubeClient(os.environ["YOUTUBE_API_KEY"]).get_top_recent_videos(
channel_id=youtube["channel_id"],
published_after=since,
top_n=int(youtube.get("digest_count", 3)),
README.md:12
- The README still describes this as a continuously running “Discord bot” and says the “digest day” is configurable via
config/config.yaml, but the refactor removesdigest_dayfrom config and runs as a short-lived cron script. This mismatch is confusing for new users and contradicts the updated cron-oriented bullets.
- ⏰ **Cron-ready** — runs once on Thursday, posts both digests, and exits; no continuously running process is required.
- 🔒 **Secure by default** — secrets live in `.env` (gitignored) or host environment variables; never in source control.
- ⚙️ **Configurable** — digest day, topics, channel IDs, and feed URL are all in `config/config.yaml`.
LOCAL_SETUP.md:60
- This bullet says the process “logs in” and only posts when run on Thursday, but the new implementation doesn’t maintain a Gateway session/login and will post whenever
main.pyis invoked. This makes local expectations unclear.
- The process logs in, posts the configured digests when run on Thursday, and exits.
- Files reviewed: 18/20 changed files
- Comments generated: 0 new
- Review effort level: Low
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation