1.8 KiB
1.8 KiB
Project: subreddit-announcer
A Discord bot that announces new Reddit posts. A long-running discord.py
process polls each watched subreddit's /new on an interval and posts an embed
to the mapped Discord channel for every previously-unseen submission. Reddit
access is read-only via asyncpraw; state is a local SQLite DB. Subreddits are
managed at runtime with slash commands.
Working agreement
- This is a git repo with
originon Forgejo athttps://git.rdx4.com/megaproxy/subreddit-announcer.git(private). HTTPS auth uses the token in~/.git-credentials— pushes are non-interactive. - Commit after each logical change with a one-line imperative message;
git pushafter each commit (or at minimum before ending the session). - Read
memory.mdat session start. Update it before ending the session. - Never commit secrets — see
.gitignoreand the rules in~/claude/CLAUDE.md.
Project-specific notes
- Runtime: Python ≥3.10, managed with
uv(pyproject.toml+uv.lock). Deps:discord.py,asyncpraw. Run withuv run bot.py. - Config: environment variables (see
config.example.env). Real secrets (DISCORD_TOKEN,REDDIT_CLIENT_*) live inconfig.env, which is gitignored. Load before running:set -a; source config.env; set +a; uv run bot.py. - Data:
announcer.db(SQLite) is created on first run and gitignored. Tables:watches(subreddit→channel +bootstrappedflag) andseen_posts(dedup, pruned to 500/subreddit). - Bootstrap behaviour: a newly-watched subreddit is silently baselined —
existing
/newposts are marked seen, not announced. Only posts created after the watch starts are announced. Re-watching resets the flag. - No privileged intents — the bot only posts, never reads message content.
- No tests yet. Syntax check:
uv run python -m py_compile bot.py.