DiscordChatExporter: Export Discord Chat History
{{DiscordChatExporter}} by {{Tyrrrz}} is a cross-platform open-source tool that exports {{Discord}} channels to HTML, JSON, CSV, or TXT, supporting both {{user token}} and {{bot token}} authentication, with the user-token path technically violating Discord's {{Terms of Service}}.
DiscordChatExporter (GitHub: Tyrrrz/DiscordChatExporter) is a free, open-source utility for archiving Discord channel history. It ships as both a GUI desktop app and a CLI (`DiscordChatExporter.Cli`), runs on Windows, macOS, and Linux, and has an official Docker image for headless or scripted exports. The current release line is the 2.x series (2.47.x as of early 2026). ## Export formats - HTML — self-contained pages (dark or light theme) that render markdown, embeds, attachments, reactions, and custom emoji offline. Best for human reading and archival. - JSON — full message metadata: timestamps, author IDs, edits, reactions, attachment URLs, embed payloads. Best for AI pipelines, search indexing, or any programmatic post-processing. - CSV — flat tabular format for spreadsheets and quick analysis. Lossy: drops nested structures like embeds and reactions. - Plain text (TXT) — message-content only, suitable when metadata is irrelevant. For LLM ingestion the JSON format is recommended because conversation context (who said what when, in reply to whom) is preserved. ## Authentication: two paths, very different risk **Bot token (recommended, ToS-safe).** Create a Discord application in the Developer Portal, generate a bot token, enable the **Message Content Intent**, and invite the bot to the target server with read permissions on the channels you want. This is the official Discord API path and carries no account-ban risk. Limitation: bots can only read channels in guilds they have been explicitly invited to — they cannot access your DMs, group DMs, or servers you haven't authorized them to join. **User token (works everywhere, against ToS).** Pulling your own user token from the Discord client lets the tool see exactly what you see — DMs, group DMs, every server you're in. This is called self-botting and Discord's Terms of Service explicitly forbid automating user accounts outside the OAuth2/bot API. Enforcement is inconsistent — many people use it daily without incident — but there are documented cases of warning emails and account terminations. Tyrrrz's README carries an explicit warning to prefer bot tokens when possible. ## Filtering and large exports The CLI supports date-range filters (`--after`, `--before`), per-channel or per-guild selection, message-content regex filtering, and **file partitioning** which splits very large channels into chunks of N messages or N MB so single export files stay manageable. Media attachments can be optionally downloaded alongside the transcript, which is essential for true offline archives but multiplies disk usage. Bulk workflows typically: enumerate channels via the `channels` or `guilds` subcommands, then loop `export` over each channel ID. Many archivists run this from Docker on a cron schedule. ## Use cases - **Personal archive** before leaving a server, or before a community shuts down. - **Research and OSINT** — Bellingcat's investigative toolkit lists DiscordChatExporter as a standard method for documenting public Discord communities. - **Compliance and moderation** — server owners snapshotting channels for record-keeping. - **AI training and retrieval-augmented generation|retrieval-augmented-generation corpora** — JSON exports feed cleanly into embedding pipelines. ## Alternatives - **Discord Data Request** — Discord's first-party GDPR-compliant export. Available in User Settings → Privacy & Safety → Request all of my Data. Delivers a ZIP of JSON files (messages, servers, activity) by email within ~30 days. It only contains *your own* messages and activity, not other people's, and isn't suitable for archiving a whole channel. - **discord-data** (PyPI) — a Python parser that turns Discord's official data package into queryable structures. - **undiscord** — a browser console script focused on *deleting* (not exporting) your own messages in bulk; raises the same self-bot ToS issue. ## Caveats - Exports represent a point-in-time snapshot; later edits, deletions, or new messages aren't reflected unless you re-run. - Don't republish other people's private messages — that's a separate ethical and legal question from whether the tool itself violates ToS. - Rate limiting applies; very large or frequent exports can trigger temporary throttling from the Discord API.