Skip to content

Optionally announce donuts to invite others - #26

Open
lsha0730 wants to merge 4 commits into
mainfrom
t3code/publish-donut-scheduling
Open

Optionally announce donuts to invite others#26
lsha0730 wants to merge 4 commits into
mainfrom
t3code/publish-donut-scheduling

Conversation

@lsha0730

@lsha0730 lsha0730 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

User flow

After each weekly pairing, DinuBot posts a Publish donut 🍩 button in the new group DM.

  1. Members agree on a date/time, location, and activity in the DM.
image
  1. A member clicks Publish donut or runs the /publish slack command.
image
  1. DinuBot asks for consent before sending the DM history to the LLM. Alternatively users run /publish <context> to limit the LLM's context to a specified value.
image
  1. The LLM extracts the meetup details, including relevant activity context and emojis, and generates a draft.
image
  1. Members can:
    • Approve & Publish
    • Discard
    • Reply in the draft thread and mention @DinuBot to request a revision
image image
  1. Approval posts the meetup to the configured public channel with I’m in! and Leave buttons.
image
  1. The public post displays the current roster. Join attempts after the configured maximum receive an ephemeral roster-full message.
image
  1. Publishing fails visibly when required details, configuration, or LLM output are unavailable; there are no heuristic fallbacks.

New commands:

  • /publish — starts the normal consent and DM-history flow.
  • /publish <custom context> — generates a draft from the supplied text instead of the DM history.
  • /set-timezone — opens a modal for configuring the club timezone.
  • /set-donut-roster-max <positive integer> — updates the maximum roster size.

Maintainer requirements

New environment configuration:

  • OPENAI_API_KEY — required for publishing.
  • OPENAI_MODEL — optional; defaults to gpt-5.6-luna.
  • PUBLISH_CHANNEL_ID — required public channel for published donuts.
  • ALL_MEMBERS_CHANNEL — required pairing/member channel, replacing the previous channelID configuration.

The Slack app must also register the new slash commands and have the permissions needed to read the pairing DMs and post/update messages in the configured public channel.

Publishing requires the club timezone and roster maximum to be configured in Firestore. The InternalProjects/DinuBot document now stores:

  • clubTimezone
  • donutRosterMax

The publish feature uses two subcollections beneath that document:

  • pendings — temporary draft previews awaiting approval or discard.
  • publishes — published meetup records, including Slack message references, details, and roster state.

The Slack SDK was upgraded to Bolt 4 / Web API 7 to resolve the Socket Mode disconnect issue. Node.js 18 or newer is required.

Code structure

  • src/publish/workflows.js coordinates the draft, review, and publish lifecycle.
  • src/publish/handlers/ contains Slack command, action, modal, and event handlers.
  • src/publish/llm/ encapsulates prompts, structured-output schemas, and OpenAI calls.
  • src/publish/slack/ contains Block Kit presentation, conversation access, and Slack message operations.
  • src/publish/repository.js owns Firestore validation, persistence, and transactional roster updates.
  • src/publish/drafts.js constructs the deterministic final announcement from the LLM’s structured details.
  • index.js integrates the publish module with the existing pairing application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant