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.
Overview
The!export command exports all messages from your Discord server within a specified time range to a structured JSON file. This command captures complete message data including content, metadata, attachments, and reactions.
Command Syntax
Number of hours to look back for messages
- Minimum: 1 hour
- Maximum: 720 hours (30 days)
- Default: 24 hours (if not specified)
What Gets Exported
The export includes comprehensive data for each message:Message Data
- Message content: Original text and cleaned content (with mentions resolved)
- Author information: Name, display name, user ID, bot status
- Timestamps: Both Eastern Time and UTC, including edit timestamps
- Attachments: Filename, URL, and file size for each attachment
- Reactions: Emoji and reaction count
- Mentions: User mentions, channel mentions, and role mentions
- Thread information: Thread name if message is in a thread
- Embeds: Count of embedded content
Metadata
- Guild/server name
- Export timestamp (ET and UTC)
- Time range in hours
- Channel information for each exported channel
Output Format
Exports are saved to theexports/ directory with the naming pattern:
JSON Structure
- Overall Structure
- Message Structure
Example Usage
- Default (24 hours)
- Custom Time Range
- Weekly Export
Error Handling
Permission ErrorsChannels the bot cannot access are skipped with a warning in logs:The export continues for accessible channels.
Empty ExportsIf no messages are found in the time range, the export will complete successfully but with 0 messages.
Technical Details
Performance
- Concurrent export: All channels are exported in parallel using
asyncio.gather() - No message limit: Fetches all messages within the time range
- Timezone handling: Automatically handles DST transitions for Eastern Time
Mention Resolution
The bot resolves Discord’s internal mention format to readable names:<@123456>→@Username<#789012>→#channel-name<@&345678>→@RoleName
File Location
See bot.py:204-256 for the core export implementation.Related Commands
- !digest - Generate AI-powered digest from exported data
- Scheduled Tasks - Automatic daily export and digest