Public
Like
2
vt-discord
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.
httpHandler.ts
https://boucher--751ff414288411f0b137569c3dd06744.web.val.run
A Discord bot that archives conversations between you and your partner in a private server, tracks shared links, and allows intelligent searching and analysis of past discussions using Claude AI. The bot can also import historical DM conversations from Discord's data export.
- Message Archiving: Records all messages exchanged in your private server
- Historical DM Import: Import your conversation history from Discord data exports
- Link Tracking: Automatically extracts and categorizes shared links
- AI-Powered Analysis: Use Claude to query your conversation history
- Project Organization: Group conversations by topics or projects
- Discord Command Interface: Interact with your data directly through Discord
- Discord Bot Token
- Discord Application ID
- Anthropic API Key (for Claude)
- A private Discord server with just you and your partner
- Val Town account for hosting
/query what tables did we like for the dining room?
/links list
/links search ikea
/project create name:Furniture description:Our furniture shopping journey
/project list
/import channel channel_id:123456789
/import dm
(generates upload link for DM history)
-
Create a Discord application and bot at the Discord Developer Portal
-
Create a private server with just you and your partner
-
Invite the bot to your server with the following permissions:
- Read Messages/View Channels
- Send Messages
- Read Message History
- Use Slash Commands
-
Set up the environment variables in Val Town:
DISCORD_TOKEN
: Your Discord bot tokenDISCORD_APPLICATION_ID
: Your Discord application IDANTHROPIC_API_KEY
: Your Claude API keyVAL_TOWN_URL
: The URL of your Val Town deployment
-
Register the bot commands by making a POST request to the
/register
endpoint
There are two ways to import your conversation history:
- Go to User Settings → Privacy & Safety in Discord
- Request your data export
- When you receive it, use the
/import dm
command to generate an upload link - Upload your messages JSON file to the provided link
- Find the ID of the channel you want to import (enable Developer Mode in Discord)
- Use the command
/import channel channel_id:YOUR_CHANNEL_ID
- If there are more than 100 messages, the command will tell you how to paginate for more
id
: Unique message IDchannel_id
: Discord channel IDuser_id
: Discord user IDcontent
: Message text contenttimestamp
: Unix timestamphas_links
: Boolean indicating if message contains linksis_command
: Boolean indicating if message is a command
id
: Auto-incrementing IDmessage_id
: Reference to message containing the linkurl
: Full URLdomain
: Domain nametimestamp
: Unix timestampcategory
: Optional category tag
id
: Auto-incrementing IDname
: Project namedescription
: Optional project descriptioncreated_at
: Unix timestampis_active
: Boolean status
id
: Auto-incrementing IDname
: Topic namedescription
: Optional topic descriptioncreated_at
: Unix timestamp
This bot uses:
- Discord API for bot functionality
- SQLite for persistent storage
- Claude API for natural language processing and conversation analysis
- Val Town for serverless hosting
- All data is stored within Val Town's secure environment
- Only conversations in channels where the bot is invited are recorded
- The bot does not share your conversation data with any third parties (except Claude for processing queries)
- The bot only processes messages after it has been added to a channel
- Historical messages prior to bot installation need to be imported separately
- Some advanced search capabilities require specific phrasing
- Web interface for more detailed data exploration
- Better automatic topic categorization
- Image and attachment tracking
- Sentiment analysis of conversations