Repository navigation
Post a game's releases to its players' Discord channel - #23
Merged
Merged
Conversation
A new door, POST /announce, takes a title, the release's lines and an optional https address from the game's own tools, behind the same key as /notify, and posts them as one embed to a Discord channel's webhook. The webhook's URL is a Worker secret named by bindings.announceWebhook (ANNOUNCE_WEBHOOK by default) and is never logged, since it holds the webhook's token. The post pings nobody whatever the lines say, and the title and the lines are cut to Discord's 256 and 4,096 characters. Without the secret the door answers 503; a refusal from Discord comes back as a 502 with its status, so a tool can say the post did not go. It joins the unreleased 0.7.0. Checked: lefthook run pre-commit --all-files, every gate clean (lockfile, lint, format, file-size, strict-mode, english-only, worker, types); npm test, 94 tests pass, 6 of them new; three mutants (the cap's boundary, the dropped allowed_mentions, an ignored refusal) each failed one test and were restored. No real Discord webhook was posted to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A new door,
POST /announce, takes{ title, text, url? }from a game's own tools, behind the ingest key, and posts it as one embed to a Discord channel's webhook. The webhook's URL is a Worker secret named bybindings.announceWebhook(ANNOUNCE_WEBHOOKby default) and is never logged. Nobody is pinged (allowed_mentions: { parse: [] }); the title and the lines are cut to Discord's 256 and 4,096. Without the secret: 503. Discord's refusal: 502 with its status (0 when nothing answered).Joins the unreleased 0.7.0 (the local mirror); README's doors, config and a setup section, and the changelog's Added and Not done.
Checked: every pre-commit gate clean; 94 Worker tests, 6 new; three mutants (cap boundary, mentions, an ignored refusal) each killed. Not posted to a real Discord webhook.
🤖 Generated with Claude Code