Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/trustlessmatt/discord-exporter-bot/llms.txt

Use this file to discover all available pages before exploring further.

Quick Start Guide

Get your Discord Exporter Bot up and running quickly with this streamlined guide.

Prerequisites

Before you begin, make sure you have:

Discord Bot Token

A Discord bot token with message content intent enabled

Python 3.11+

Python 3.11 or higher installed on your system

Guild ID

Your Discord server’s Guild ID

Anthropic API Key

Optional - for AI digest features
The bot will work without an Anthropic API key, but the !digest command will be unavailable. You can still use !export to archive messages.

Installation

1

Clone or download the bot code

Get the bot.py file and create a project directory:
mkdir discord-exporter-bot
cd discord-exporter-bot
# Copy bot.py into this directory
2

Install dependencies

Create a requirements.txt file with these dependencies:
requirements.txt
discord.py==2.3.2
python-dotenv==1.0.0
anthropic==0.40.0
Then install:
pip install -r requirements.txt
3

Configure environment variables

Create a .env file in your project directory:
.env
DISCORD_TOKEN=your_discord_bot_token_here
GUILD_ID=your_guild_id_here
ANTHROPIC_API_KEY=your_anthropic_key_here
Replace the placeholder values with your actual credentials. Never commit the .env file to version control.
Required variables:
  • DISCORD_TOKEN - Your Discord bot token
  • GUILD_ID - Your Discord server’s ID (right-click server → Copy Server ID)
Optional variables:
  • ANTHROPIC_API_KEY - For AI digest generation
  • DOKPLOY_VOLUME_PATH - Custom path for digest output
  • GITHUB_REPO_URL - Auto-commit digests to GitHub (requires GITHUB_TOKEN)
  • GITHUB_TOKEN - GitHub personal access token for auto-sync
4

Run the bot

Start the bot with:
python bot.py
You should see output like:
2026-03-04 00:00:00 - INFO - BotName#1234 has connected to Discord!
2026-03-04 00:00:00 - INFO - Bot is in 1 guild(s)
2026-03-04 00:00:00 - INFO - Connected to: Your Server Name
2026-03-04 00:00:00 - INFO - Text channels: 5
2026-03-04 00:00:00 - INFO -   - general
2026-03-04 00:00:00 - INFO -   - announcements
2026-03-04 00:00:00 - INFO - Daily digest task started

Running Your First Commands

Export Messages

In any Discord channel where the bot has access, type:
!export
This exports the last 24 hours of messages. The bot will respond with:
Starting export of last 24 hours...
✅ Export complete!
• 342 messages
• 8 channels
• Saved to `exports/discord_export_20260304_120000_ET.json`
You can specify a custom time range: !export 48 for the last 48 hours. Range: 1-720 hours (30 days).

Export Output Example

The exported JSON file contains structured data:
{
  "guild_name": "Your Server Name",
  "export_time_eastern": "2026-03-04T12:00:00-05:00",
  "export_time_utc": "2026-03-04T17:00:00+00:00",
  "timezone": "America/New_York (Eastern Time - auto DST)",
  "time_range_hours": 24,
  "channels": {
    "general": {
      "channel_id": "123456789",
      "messages": [
        {
          "message_id": "987654321",
          "author": {
            "name": "username",
            "display_name": "Display Name",
            "id": "123456789",
            "bot": false
          },
          "content": "Hello world!",
          "content_clean": "Hello world!",
          "timestamp": "2026-03-04T11:30:00-05:00",
          "timestamp_utc": "2026-03-04T16:30:00+00:00",
          "edited_timestamp": null,
          "attachments": [],
          "embeds": 0,
          "reactions": [],
          "mentions": [],
          "channel_mentions": [],
          "thread": null
        }
      ]
    }
  }
}

Generate AI Digest

This command requires an ANTHROPIC_API_KEY in your .env file.
To generate an AI-powered summary of team activity:
!digest
The bot will respond with:
🤖 Generating digest for last 24 hours...
✅ Daily Digest Generated

## Individual Updates

**John** - Completed the authentication refactor and pushed to staging...

**Sarah** - Working on the new dashboard UI, made good progress on...

## Blockers & Challenges

- John mentioned needing design review for the login flow
- Database migration still pending approval

...

📁 Full digest: `Daily Digests/2026-03-04 - Team Digest.md`
Like exports, you can specify hours: !digest 48 for a 48-hour digest.

Digest Output Example

The generated Markdown file (Daily Digests/2026-03-04 - Team Digest.md):
---
date: 2026-03-04
type: daily-digest
tags: [team, standup, daily]
contributors: 5
messages: 342
channels: 8
---

# Team Digest - 2026-03-04

**📊 Activity Summary**
- 342 messages across 8 channels
- 5 active team members
- Time range: Last 24 hours

---

## Individual Updates

**John** - Completed authentication refactor...

**Sarah** - Working on dashboard UI...

## Upcoming Work

- John plans to start on the API documentation
- Sarah will tackle mobile responsiveness next

## Blockers & Challenges

- Design review needed for login flow
- Database migration approval pending

## Key Decisions & Ideas

- Team agreed to use TypeScript for new services
- Decided to postpone the analytics feature to next sprint

## Action Items

- [ ] John: Schedule design review meeting
- [ ] Sarah: Create Figma mockups for mobile views
- [ ] Team: Review and approve DB migration plan

---

**🔗 Links**
- [[2026-03-03 - Team Digest|← Previous Day]]
- [[2026-03-05 - Team Digest|Next Day →]]

---
*Auto-generated at 12:00 AM ET from Discord*

Automatic Daily Digests

The bot automatically generates a daily digest at midnight Eastern Time (12:00 AM ET) using the default 24-hour window. No manual intervention required! You’ll see this in the logs:
2026-03-04 00:00:00 - INFO - Running scheduled daily digest
2026-03-04 00:00:15 - INFO - ✅ Daily digest completed successfully
The scheduled time (default 12am ET) and time range (default 24 hours) can be customized in the Config class in bot.py (lines 39-40).

What’s Next?

Now that you have the bot running:

Detailed Installation

Learn about Docker setup, GitHub sync, and advanced configuration

Configuration Guide

Customize the bot’s behavior and output

Build docs developers (and LLMs) love