Skip to content

Add /closing-time, posted automatically when the space closes - #81

Merged
NinjaLikesCheez merged 4 commits into
mainfrom
cursor/closing-time-3171
Oct 10, 2026
Merged

NinjaLikesCheez merged 4 commits into
mainfrom
cursor/closing-time-3171

Conversation

@NinjaLikesCheez

@NinjaLikesCheez NinjaLikesCheez commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Members can post a closing-time reminder with /closing-time. The same send path runs automatically after a confirmed space-closed announcement. Admins set the text with /admin closing-time set.

Behaviour

  • One feature (features/closing-time), one send path: both the slash command and the space-closed hook announce closing.time through the Announcer. The Discord adapter publishes it; the feature never talks to Discord.
  • /closing-time access.minTier: member. Posts to a configured channel (typically members). No new capability.
  • /admin closing-time set access.minTier: admin. Opens a modal; if a message is already saved, the modal is prefilled so it can be tweaked. The submitted text is written atomically to PIXEL_DATA_DIR/closing-time.md. On Azure that directory is the Files share (/app/persist/data) — the write persists there; there is no extra sync step.
  • Mentions stay disabled on the Discord post.
  • If posting is off: /closing-time replies privately that it is off; the auto path logs closing_time.disabled and does not fail space-close. Admins can still set the text.
  • just register must be re-run after this rename so Discord lists /admin closing-time set instead of /admin set closing-time.

Configure

What How
Where / whether DISCORD_CLOSING_TIME_CHANNEL_ID — a Discord channel ID, or unset / off / none to disable both post paths
Content /admin closing-time set (modal, prefilled when a message is already saved), or edit data/closing-time.md / PIXEL_CLOSING_TIME_FILE. Missing or empty → built-in English default. Pixel reads the file each time it posts.

The body is a file, not an env var, because it is typically a multi-line checklist (awkward in .env and Azure settings) and is not a secret. Do not put door codes or passwords in it. Operator text in the portable text field goes through escapeMarkdown; Discord posts the body as written with mentions off (same idea as /schedule).

Auth

No new capability. Does not touch core/access*, core/identity*, core/registry* or services/access-config*.

Needs a human reviewer: core/command.ts and core/dispatcher.ts — beforeForm may now return values so a form can open with saved text. Access checks are unchanged.

Live try on pixel-dev

After the first deploy, /closing-time showed Discord's "I don't know that command" / an interaction error and then still posted. That was two Pixels on the Pixel Dev token: Azure pixel-dev--0000008 plus a leftover local pixel-main container (schedule-posts worktree, same app/guild). The leftover instance is stopped. Azure is one healthy replica. Discord 40060/10062 is now logged as discord.duplicate_handler instead of reported as a crash.

Retry /closing-time and /admin closing-time set on Pixel Dev after this revision is deployed and registered. Do not also run just dev or another container on that token.

Tests

just check passed (1649 tests). Fake CommandContext and fake announcer. Dispatcher tests for guest/member deny, admin write, and modal prefill.

Off origin/main. Not mixed with Tailscale / #76.

Open in Web Open in Cursor 

Members can post a configurable closing-time message. The same send path
runs automatically after a confirmed space-closed announcement. Both
no-op when the destination channel is unset, off, or none.
Admins set the reminder in a Discord modal. Pixel writes
data/closing-time.md atomically; on Azure that path is the Files share.
Two Pixels on one token made /closing-time post and then fail the
interaction ACK. Log that as discord.duplicate_handler instead of a crash.
The form opens with the saved reminder when one exists, so admins can
tweak it. beforeForm may now return field values for that.
@NinjaLikesCheez
NinjaLikesCheez marked this pull request as ready for review October 10, 2026 16:02
@NinjaLikesCheez
NinjaLikesCheez merged commit 9e8aa33 into main Oct 10, 2026
4 checks passed
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