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

stevekrouse

auto-thread

Public
Like
2
auto-thread
Home
Code
3
README.md
C
main.ts
sqlite.ts
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
2/15/2026
Viewing readonly version of main branch: v32
View latest version
README.md

auto-thread

Automatically creates Discord threads from new messages in configured channels, using OpenAI to generate descriptive thread titles.

How It Works

Rendering mermaid diagram...

Files

FileTypePurpose
main.tsintervalCore loop: poll channels → generate title → create thread
sqlite.tsscriptTrack last-processed message ID per channel

Setup

  1. Set DISCORD_BOT_TOKEN env var
  2. Edit WATCH_CHANNELS in main.ts with your channel IDs
  3. Set the interval schedule

Required Bot Permissions

  • VIEW_CHANNEL
  • READ_MESSAGE_HISTORY
  • SEND_MESSAGES
  • CREATE_PUBLIC_THREADS
  • SEND_MESSAGES_IN_THREADS

Dependencies

  • npm:@discordjs/rest — Discord REST API with rate limiting and retries
  • npm:discord-api-types — Full TypeScript types for the Discord API
  • std/openai — Val Town's OpenAI wrapper
  • std/sqlite — Val Town's project-scoped SQLite
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.