https://github.com/wei/discord-chunker
🗨️ A Discord webhook proxy that intelligently chunks long messages
https://github.com/wei/discord-chunker
discord discord-webhook discord-webhooks
Last synced: 4 months ago
JSON representation
🗨️ A Discord webhook proxy that intelligently chunks long messages
- Host: GitHub
- URL: https://github.com/wei/discord-chunker
- Owner: wei
- License: mit
- Created: 2026-02-10T03:17:50.000Z (5 months ago)
- Default Branch: master
- Last Pushed: 2026-02-10T07:39:06.000Z (5 months ago)
- Last Synced: 2026-02-10T09:43:30.378Z (5 months ago)
- Topics: discord, discord-webhook, discord-webhooks
- Language: TypeScript
- Homepage: https://discord.git.ci/chunker
- Size: 736 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README

A Discord webhook proxy that intelligently chunks long messages. Drop-in replacement — just swap the URL.
## Usage
Replace your Discord webhook URL:
```diff
- https://discord.com/api/webhooks/123/token
+ https://discord.git.ci/api/webhook/123/token
```
Messages under 1950 characters pass through unchanged. Longer messages are split intelligently:
- Splits at line boundaries (never mid-line)
- Respects both character and line count limits
- Fence delimiter lines excluded from line count
- Code blocks properly closed/reopened when split across chunks
- Hard-cuts only when a single line exceeds the character limit
Note: when a split occurs inside an active code fence, temporary close/reopen fence wrapper lines may cause a chunk to exceed the configured `max_chars`. This is intentional for fence integrity. The hard Discord limit of 2000 characters is still enforced.
## Health Endpoint
`GET /health` returns a lightweight service status payload that includes both the service identity/version and the incoming request User-Agent.
Example response:
```json
{
"status": "ok",
"service": "discord-chunker",
"version": "0.1.0",
"service_user_agent": "discord-chunker/0.1.0",
"request_user_agent": "curl/8.7.1",
"timestamp": "2026-02-10T04:45:00.000Z"
}
```
The response also includes the `X-Service` header set to the service User-Agent string.
## Configuration
| Param | Default | Range | Description |
|-------|---------|-------|-------------|
| `max_chars` | 1950 | 100-2000 | Max characters per chunk |
| `max_lines` | 20 | ≥ 0 (0 = unlimited) | Max lines per chunk (fence lines excluded) |
| `thread_id` | — | — | Forward to thread |
| `wait` | omitted | true/false | Return message object of the first chunk (omitted = Discord default) |
```bash
POST /api/webhook/123/token?max_chars=1500&max_lines=25&thread_id=999
```
## Prerequisites
- [Node.js](https://nodejs.org/) >= 22
## Deploy
```bash
pnpm install
pnpm wrangler login
pnpm deploy
```
## Development
```bash
pnpm install
pnpm dev # Local dev server
pnpm test # Run tests
```
## Design
See [design document](docs/plans/design.md) for full architecture details.