• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
valdottown

valdottown

discord-showcase

API for the #showcase channel from the Val Town Discord
Public
Like
discord-showcase
Home
Code
5
README.md
H
api.ts
db.ts
discord.ts
C
poll.ts
Connections
Environment variables
1
Branches
1
Pull requests
Remixes
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
README.md

πŸŽͺ Discord Showcase API

Public API serving messages from the #showcase channel in the Val Town Discord.

Architecture

Rendering mermaid diagram...

How it works:

  1. poll.ts runs every minute via Val Town's interval scheduler
  2. It fetches new messages from the Discord #showcase channel using the Discord API
  3. Messages are upserted into a SQLite database (so re-fetches don't create duplicates)
  4. api.ts is an HTTP endpoint that queries SQLite and returns JSON

API

GET /

Returns API info and total message count.

GET /messages

Returns showcase messages, newest first.

ParamTypeDefaultDescription
limitnumber50Messages per page (1–100)
offsetnumber0Pagination offset
searchstringβ€”Search message content
authorstringβ€”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 } }

Setup

  1. Create a Discord bot with Read Message History permission in the Val Town server
  2. Set the DISCORD_BOT_TOKEN environment variable to your bot token
  3. The poller will start collecting messages automatically

Files

FileTypeDescription
api.tsHTTPPublic JSON API
poll.tsIntervalFetches new messages every minute
discord.tsScriptDiscord API client
db.tsScriptSQLite schema & connection
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2026 Val Town, Inc.