Discord bridge — mirror posts to channels and replies back as comments #4

Closed
opened 2026-06-23 05:37:08 +00:00 by sscoble · 0 comments
Owner

Why

Discord is the front door. We don't replace it; we add a layer beneath it that knows about agents, posts, and bumps.

What to do

  1. Direction A (posts → Discord): when a new post is created in a channel that has a Discord mirror (configurable), the bridge posts to the corresponding Discord channel with author + body + a link back to os.scoble.me/posts/<id>.
  2. Direction B (Discord → posts): when a reply is added in the mirrored Discord thread, the bridge creates a comments row with parent_id set to the original post's "first comment" (a special root comment per post).
  3. Auth mapping: Discord users map to authors rows by Discord ID. Auto-create the author on first message (kind=human, display_name = Discord display name).
  4. Bump sync: when a post gets a new comment via the API, the bridge should NOT mirror that to Discord as a new message — it should send a "↳ reply" line so the bump happens in the API but the Discord channel doesn't get noisy. (This is a design choice — confirm in the open question below.)
  5. Implementation: a small Python service (FastAPI? or just discord.py running as a systemd user unit) that subscribes to the posts API via a webhook AND uses the Discord gateway. Lives in bridge/discord/ in this repo.

Acceptance

  • A post created via the API with channels: ["scobleclaw"] shows up in the #scobleclaw Discord channel within 5 seconds.
  • A reply in the corresponding Discord thread creates a new comment in the API.
  • A new comment on a post in the API does NOT spam the Discord channel with a new message.

Out of scope

  • Multi-server (one Discord server for v0)
  • Reactions / emoji → API state (deferred to v0.5)
  • Voice / threads-in-threads

Open questions for Scott

  • Bump vs new-message in Discord: my default is "↳ reply" (no new message) because Theo specifically called out noise. But if you'd rather every reply be a Discord message (so people see replies in Discord), say so.
  • Author auto-create on first Discord message: is that OK, or do you want to approve each mapping? Default: auto-create; revoke-able via a /unlink slash command.
  • One-way or two-way for v0? If two-way is risky, ship one-way (API → Discord) first; the v0.5 bridge goes both ways.
  • Which Discord server first? #scobleclaw? #board-room? A new #posts-dev test channel?
## Why Discord is the front door. We don't replace it; we add a layer beneath it that knows about agents, posts, and bumps. ## What to do 1. **Direction A (posts → Discord)**: when a new post is created in a channel that has a Discord mirror (configurable), the bridge posts to the corresponding Discord channel with author + body + a link back to `os.scoble.me/posts/<id>`. 2. **Direction B (Discord → posts)**: when a reply is added in the mirrored Discord thread, the bridge creates a `comments` row with `parent_id` set to the original post's "first comment" (a special root comment per post). 3. **Auth mapping**: Discord users map to `authors` rows by Discord ID. Auto-create the author on first message (kind=human, display_name = Discord display name). 4. **Bump sync**: when a post gets a new comment via the API, the bridge should NOT mirror that to Discord as a new message — it should send a "↳ reply" line so the bump happens in the API but the Discord channel doesn't get noisy. (This is a design choice — confirm in the open question below.) 5. **Implementation**: a small Python service (FastAPI? or just `discord.py` running as a systemd user unit) that subscribes to the posts API via a webhook AND uses the Discord gateway. Lives in `bridge/discord/` in this repo. ## Acceptance - A post created via the API with `channels: ["scobleclaw"]` shows up in the `#scobleclaw` Discord channel within 5 seconds. - A reply in the corresponding Discord thread creates a new comment in the API. - A new comment on a post in the API does NOT spam the Discord channel with a new message. ## Out of scope - Multi-server (one Discord server for v0) - Reactions / emoji → API state (deferred to v0.5) - Voice / threads-in-threads ## Open questions for Scott - **Bump vs new-message in Discord**: my default is "↳ reply" (no new message) because Theo specifically called out noise. But if you'd rather every reply be a Discord message (so people see replies in Discord), say so. - **Author auto-create on first Discord message**: is that OK, or do you want to approve each mapping? Default: auto-create; revoke-able via a `/unlink` slash command. - **One-way or two-way for v0?** If two-way is risky, ship one-way (API → Discord) first; the v0.5 bridge goes both ways. - **Which Discord server first?** `#scobleclaw`? `#board-room`? A new `#posts-dev` test channel?
sscoble added the
area/bridge
kind/feature
prio/p1
labels 2026-06-23 05:37:08 +00:00
Author
Owner

Closed by dispatch system (c2328)

Subagent completed Discord bridge implementation. All 12 tests pass:

 bridge/discord/ — bridge.go, client.go, config.go, state.go, bridge_test.go
 go test -v ./bridge/discord/ — 12/12 PASS

Delivered: Message formatting (with truncation), Discord author ID mapping, channel-slug config (bidirectional), config validation, state record/lookup, synced comments, author display, poll duration. Plus cmd/posts-discord-bridge/main.go entrypoint and systemd service file.

Code is in working tree (uncommitted).

## Closed by dispatch system (c2328) Subagent completed Discord bridge implementation. All 12 tests pass: ``` bridge/discord/ — bridge.go, client.go, config.go, state.go, bridge_test.go go test -v ./bridge/discord/ — 12/12 PASS ``` **Delivered:** Message formatting (with truncation), Discord author ID mapping, channel-slug config (bidirectional), config validation, state record/lookup, synced comments, author display, poll duration. Plus `cmd/posts-discord-bridge/main.go` entrypoint and systemd service file. Code is in working tree (uncommitted).
Sign in to join this conversation.
No description provided.