Public API serving messages from the #showcase channel in the Val Town Discord.
Rendering mermaid diagram...
How it works:
poll.ts runs every minute via Val Town's interval scheduler#showcase channel using the Discord APIapi.ts is an HTTP endpoint that queries SQLite and returns JSONReturns API info and total message count.
Returns showcase messages, newest first.
| Param | Type | Default | Description |
|---|---|---|---|
limit | number | 50 | Messages per page (1–100) |
offset | number | 0 | Pagination offset |
search | string | — | Search message content |
author | string | — | Filter by author username |
Example response:
{ "messages": [ { "id": "123456789", "author_id": "987654321", "author_username": "cool_dev", "author_avatar": "abc123", "content": "Check out my new val! ...", "timestamp": "2025-01-15T12:00:00.000Z", "attachments": [], "embeds": [...], "reactions": [{ "count": 5, "emoji": { "id": null, "name": "🔥" } }], "reply_to_id": null, "thread_id": null, "thread_name": null } ], "pagination": { "limit": 50, "offset": 0, "total": 1234, "has_more": true } }
DISCORD_BOT_TOKEN environment variable to your bot token| File | Type | Description |
|---|---|---|
api.ts | HTTP | Public JSON API |
poll.ts | Interval | Fetches new messages every minute |
discord.ts | Script | Discord API client |
db.ts | Script | SQLite schema & connection |