• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
boucher

boucher

vt-discord

Public
Like
2
vt-discord
Home
Code
12
.claude
1
backend
6
frontend
shared
.cursorrules
.gitignore
.vtignore
README.md
C
cronHandler.ts
deno.json
H
httpHandler.ts
index.ts
Branches
1
Pull requests
Remixes
History
Environment variables
7
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
5/3/2025
Viewing readonly version of main branch: v29
View latest version
README.md

Discord Conversation Tracker & Analysis Bot

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.

Features

  • 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

Requirements

  • 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

Command Examples

  • /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)

Setup Instructions

  1. Create a Discord application and bot at the Discord Developer Portal

  2. Create a private server with just you and your partner

  3. Invite the bot to your server with the following permissions:

    • Read Messages/View Channels
    • Send Messages
    • Read Message History
    • Use Slash Commands
  4. Set up the environment variables in Val Town:

    • DISCORD_TOKEN: Your Discord bot token
    • DISCORD_APPLICATION_ID: Your Discord application ID
    • ANTHROPIC_API_KEY: Your Claude API key
    • VAL_TOWN_URL: The URL of your Val Town deployment
  5. Register the bot commands by making a POST request to the /register endpoint

Importing Historical DMs

There are two ways to import your conversation history:

Method 1: Discord Data Export (For Private DMs)

  1. Go to User Settings → Privacy & Safety in Discord
  2. Request your data export
  3. When you receive it, use the /import dm command to generate an upload link
  4. Upload your messages JSON file to the provided link

Method 2: Channel History Import (For Server Messages)

  1. Find the ID of the channel you want to import (enable Developer Mode in Discord)
  2. Use the command /import channel channel_id:YOUR_CHANNEL_ID
  3. If there are more than 100 messages, the command will tell you how to paginate for more

Database Schema

Messages

  • id: Unique message ID
  • channel_id: Discord channel ID
  • user_id: Discord user ID
  • content: Message text content
  • timestamp: Unix timestamp
  • has_links: Boolean indicating if message contains links
  • is_command: Boolean indicating if message is a command

Links

  • id: Auto-incrementing ID
  • message_id: Reference to message containing the link
  • url: Full URL
  • domain: Domain name
  • timestamp: Unix timestamp
  • category: Optional category tag

Projects

  • id: Auto-incrementing ID
  • name: Project name
  • description: Optional project description
  • created_at: Unix timestamp
  • is_active: Boolean status

Topics

  • id: Auto-incrementing ID
  • name: Topic name
  • description: Optional topic description
  • created_at: Unix timestamp

Implementation Details

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

Privacy & Security

  • 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)

Limitations

  • 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

Future Enhancements

  • Web interface for more detailed data exploration
  • Better automatic topic categorization
  • Image and attachment tracking
  • Sentiment analysis of conversations
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.