This project is a Discord bot that analyzes direct messages between two users (e.g., you and your partner), particularly focusing on:
The project is structured to work with Val.town and has the following components:
To run this project on Val.town, you need to set up the following environment variables:
DISCORD_TOKEN
: Your Discord bot tokenDISCORD_CLIENT_ID
: Your Discord application IDDISCORD_PUBLIC_KEY
: Public key for verifying Discord interactionsDISCORD_USER_ID
: Your Discord user IDSPOUSE_USER_ID
: Your partner's Discord user IDANTHROPIC_API_KEY
: Your Anthropic API keyOAuth2 URL Generator
to create an invite link with the bot
scopeGET /health
: Check if the service is runningPOST /api/interactions
: Discord interactions endpointPOST /api/fetch-dms
: Manually trigger DM fetchingPOST /api/process-links
: Manually trigger link processingPOST /api/query
: Process a query about your messagesPOST /api/commands/search
: Endpoint for search commandsPOST /api/register-commands
: Register Discord slash commandsGET /api/cron/fetch-dms
: Cron endpoint for fetching DMsGET /api/cron/process-links
: Cron endpoint for processing linksThe bot provides several slash commands:
/search [query]
: Search your conversation history/links [category]
: Find links shared in conversations, optionally filtered by category/categories
: List all available link categories/analyze [query]
: Perform a deeper analysis of your conversations.env
file with the required environment variablesdeno cache --reload index.ts
deno run --allow-net --allow-env index.ts
A basic frontend is provided in the frontend
directory. For now, we're focusing on the backend functionality, but the frontend can be extended to provide a web interface for searching and visualizing conversation data.
This project was ported from a Node.js implementation to work specifically with Val.town's environment.