Public
Like
discordDailyDigest
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.
Daily cron val that:
- Fetches messages from a Discord channel (last 24 hours)
- Summarizes them with Val Town's OpenAI integration
- Emails the digest to you (the logged-in Val Town user)
Set these in Val Town Secrets for this val:
DISCORD_CHANNEL_IDS(required): Comma-separated Discord channel IDs to summarizeDISCORD_USER_TOKEN(required): Your personal Discord token
Optional:
DISCORD_INCLUDE_BOTS: set to"1"to include bot messages (default: exclude bots)DISCORD_MAX_MESSAGES: max messages per channel included from the last 24h (default:750)DISCORD_MAX_THREADS: max threads/posts per channel to scan (default:20) — important for Forum channels where replies live in threadsOPENAI_MODEL: OpenAI model name (default:gpt-4o-mini)
- In Discord, go to User Settings → Advanced and enable Developer Mode.
- Right-click the channels you want to summarize.
- Click Copy Channel ID for each and separate them with commas (e.g.,
123,456).
Discord user tokens (personal account tokens) allow the val to access channels your account has access to.
Use with caution:
- Risky: Automated use of user tokens ("self-botting") is against Discord's Terms of Service and can result in your account being flagged or banned.
- Sensitive: A user token is effectively your password. Never share it or commit it to a public repository.
To use a user token:
- Set
DISCORD_USER_TOKENto your personal token in Val Town Secrets. - Note: This val only reads message history, which is generally lower risk than automated posting, but still carries the risks mentioned above.
https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md
- Forum channels and threaded replies:
- If you point
DISCORD_CHANNEL_IDSat a Forum channel, this val will scan the forum’s threads/posts (plus recent archived threads) and summarize per-thread “conversations”. - For normal text channels, it will summarize the main channel timeline and also scan any discovered active/recent threads (up to
DISCORD_MAX_THREADS).
- If you point
- This val intentionally has no idempotency guard: it will email every time it runs.
- On Val Town Free, the
v/std/emailhelper can only email yourself (works fine for this use case).