feat(proxy): write pass-through — POST messages to Discord#10
Merged
Conversation
Adds POST /api/v10/channels/{channelId}/messages that forwards the
request body and Content-Type to Discord, returns the response verbatim,
and injects successfully sent messages into the cache immediately.
- Multipart/form-data bodies forwarded transparently (raw bytes)
- Safe JSON parse on Discord responses (handles non-JSON 502/503)
- Cache injection validates snowflake format before writing
- 429 rate limit: body consumed, warning logged, connection freed
- 503 returned when no DiscordClient configured (read-only mode)
54 tests across 6 files, 148 assertions.
Closes #4
Co-Authored-By: Claude Opus 4.6 <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.
Summary
Adds write pass-through so agents can send Discord messages through scream-hole. POST requests are forwarded to Discord with the response returned verbatim, and successfully sent messages are injected into the cache immediately.
Changes
sendMessagemethod on DiscordClient, refactoreddiscordFetchfor POST support, safe JSON parse for non-JSON errors, 429 body consumed + loggedTest Plan
bun test— 54 pass, 0 fail, 148 assertionsbunx tsc --noEmit— cleanCloses #4
🤖 Generated with Claude Code