### Run DiscordChatExporter via Docker Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Examples for pulling and running the DiscordChatExporter Docker image. Includes interactive exports, server exports using environment variables, and fixing Unix permissions. ```console # Pull the stable image docker pull tyrrrz/discordchatexporter:stable ``` ```console # Export a channel with interactive output docker run --rm -it \ -v /path/to/exports:/out \ tyrrrz/discordchatexporter:stable \ export -t "YOUR_TOKEN" -c 123456789012345678 -o /out/ ``` ```console # Export a full server using environment variable for token docker run --rm \ -e DISCORD_TOKEN="YOUR_TOKEN" \ -v /path/to/exports:/out \ tyrrrz/discordchatexporter:stable \ exportguild -g 869237470565392384 -o /out/ -f Json ``` ```console # Fix Unix permissions for non-1000:1000 users mkdir -p exports docker run --rm -it \ --user "$(id -u):$(id -g)" \ -v "$PWD/exports:/out" \ tyrrrz/discordchatexporter:stable \ export -t "YOUR_TOKEN" -c 123456789012345678 -o /out/ ``` -------------------------------- ### Show token and ID retrieval instructions Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Prints step-by-step instructions for obtaining a Discord user token, bot token, and server/channel IDs. ```APIDOC ## guide - Show token and ID retrieval instructions Prints step-by-step instructions for obtaining a Discord user token, bot token, and server/channel IDs. ### Method ```console ./DiscordChatExporter.Cli guide ``` ``` -------------------------------- ### Show token and ID retrieval instructions Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Displays instructions on how to find your user token, bot token, and server/channel IDs. Note that automating user accounts may violate Discord's Terms of Service. ```bash ./DiscordChatExporter.Cli guide ``` -------------------------------- ### List accessible servers (guilds) Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Prints a list of all servers (guilds) that the provided token has access to, including a special entry for Direct Messages. The output can be saved to a text file. ```bash # List all accessible servers ./DiscordChatExporter.Cli guilds -t "YOUR_TOKEN" ``` ```bash # Save to a text file ./DiscordChatExporter.Cli guilds -t "YOUR_TOKEN" > servers.txt ``` -------------------------------- ### Organize exports using output path templates Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Utilizes template tokens in the output path to automatically organize exported files based on server, category, and channel metadata. This allows for structured saving of exported data. ```bash # Organize exports as ServerName/CategoryName/ChannelName.html ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ -o "/exports/%G/%T/%C.html" ``` ```bash # Include date range in filename ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --after "2024-01-01" --before "2024-06-01" \ -o "/exports/%G - %C (%a to %b).html" ``` -------------------------------- ### Download media assets for offline viewing Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Use the `--media` flag to download all referenced assets like avatars and attachments. `--reuse-media` skips redundant downloads, and `--media-dir` specifies a custom directory for storing media. ```console # Download assets alongside the export ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID --media ``` ```console # Reuse previously downloaded assets to skip redundant requests ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID --media --reuse-media ``` ```console # Store all media in a dedicated shared directory ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --media --media-dir "/shared/discord-media/" ``` -------------------------------- ### List channels in a server Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Prints all channels in a given server to stdout, optionally including threads. Output includes channel ID and hierarchical name. ```APIDOC ## channels - List channels in a server Prints all channels in the given server to stdout. Output includes the channel ID and hierarchical name. Optionally lists threads. ### Method ```console ./DiscordChatExporter.Cli channels -t "YOUR_TOKEN" -g "SERVER_ID" [OPTIONS] ``` ### Parameters * **-t, --token** (string) - Required - Your Discord user or bot token. * **-g, --guild** (string) - Required - The ID of the server (guild) to list channels from. * **--include-vc** (boolean) - Optional - Whether to include voice channels. Defaults to true. * **--include-threads** (string) - Optional - Whether to include threads. Can be `all`, `active`, or `none`. Defaults to `none`. ``` -------------------------------- ### Export Multiple Channels in Parallel with Partitioning Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports multiple channels concurrently and partitions output files by size (e.g., 10MB). Use --parallel to set the number of concurrent exports. ```console ./DiscordChatExporter.Cli export -t "YOUR_TOKEN" \ -c 111 -c 222 -c 333 -c 444 \ -o "/exports/" -p 10mb --parallel 4 ``` -------------------------------- ### Export all channels from a personal data package Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Use this command to export all channels from a provided Discord data package zip file. Ensure you replace 'YOUR_TOKEN' with your actual Discord token and provide the correct path to your data package and desired output directory. ```bash ./DiscordChatExporter.Cli exportall -t "YOUR_TOKEN" \ --data-package "/path/to/package.zip" \ -o "/exports/" ``` -------------------------------- ### Export with different output formats Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Demonstrates how to specify the output format for exported chat data. Supported formats include HtmlDark, HtmlLight, PlainText, Json, and Csv, each suited for different use cases. ```bash # HtmlDark (default) — replicates Discord's dark-theme interface ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID -f HtmlDark ``` ```bash # HtmlLight — same as HtmlDark with a light theme ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID -f HtmlLight ``` ```bash # PlainText — smallest file size, opens in any text editor ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID -f PlainText ``` ```bash # Json — structured, machine-readable; ideal for further processing ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID -f Json ``` ```bash # Csv — tabular format; opens in Excel / Google Sheets ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID -f Csv ``` -------------------------------- ### Export Options Reference Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Reference for various export options including output format, path templates, and partitioning. ```APIDOC ## Export Options Reference ### Output format (`-f` / `--format`) Five formats are supported. The default is `HtmlDark`. * `HtmlDark`: Replicates Discord's dark-theme interface. * `HtmlLight`: Same as `HtmlDark` with a light theme. * `PlainText`: Smallest file size, opens in any text editor. * `Json`: Structured, machine-readable; ideal for further processing. * `Csv`: Tabular format; opens in Excel / Google Sheets. ```console # Example usage for HtmlDark format ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID -f HtmlDark ``` ### Output path templates (`-o` / `--output`) The output path supports template tokens that are expanded from guild/channel metadata. | Token | Expands to | |-------|----------------------| | `%g` | Server ID | | `%G` | Server name | | `%t` | Category ID | | `%T` | Category name | | `%c` | Channel ID | | `%C` | Channel name | | `%p` | Channel position | | `%P` | Category position | | `%a` | After date | | `%b` | Before date | | `%d` | Current date | | `%%` | Literal `%` | ```console # Organize exports as ServerName/CategoryName/ChannelName.html ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID -o "/exports/%G/%T/%C.html" ``` ### Partitioning (`-p` / `--partition`) Splits the export into multiple files, each capped by a message count or file size. * **By message count**: Specify the maximum number of messages per file (e.g., `-p 500`). * **By file size**: Specify the maximum file size using units like `mb` or `gb` (e.g., `-p 20mb`, `-p 1gb`). ```console # Split after every 500 messages ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID -p 500 # Split by file size: 20 MB per part ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID -p 20mb ``` ``` -------------------------------- ### Provide authentication token via environment variable Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Instead of using the `-t` flag, set the `DISCORD_TOKEN` environment variable. This is useful for CI/CD and Docker environments. ```console # Set environment variable and run export DISCORD_TOKEN="mfa.YOUR_TOKEN_HERE" ./DiscordChatExporter.Cli export -c 123456789012345678 -f Json -o "/out/" ``` ```console # Docker with environment variable docker run --rm \ -e DISCORD_TOKEN="mfa.YOUR_TOKEN_HERE" \ -v "$PWD/exports:/out" \ tyrrrz/discordchatexporter:stable \ export -c 123456789012345678 -o /out/ ``` -------------------------------- ### Export Channel with Threads and Media Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports a channel including all threads and downloads associated media assets. Use --include-threads all and --media flags. --reuse-media can prevent re-downloading. ```console ./DiscordChatExporter.Cli export -t "YOUR_TOKEN" -c 123456789012345678 \ --include-threads all --media --reuse-media ``` -------------------------------- ### Run DiscordChatExporter Tests Source: https://github.com/tyrrrz/discordchatexporter/blob/prime/DiscordChatExporter.Cli.Tests/Readme.md Execute the test suite for DiscordChatExporter using the .NET CLI. Ensure your Discord token is configured via user secrets before running. ```bash dotnet test ``` -------------------------------- ### Export Multiple Channels to Directory Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports multiple specified channels to a designated output directory. Use the -c flag for each channel ID and -o for the output path. ```console ./DiscordChatExporter.Cli export -t "YOUR_TOKEN" \ -c 123456789012345678 -c 987654321098765432 \ -o "/path/to/exports/" ``` -------------------------------- ### List accessible servers Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Prints all servers (guilds) the token can access, including the Direct Messages pseudo-guild. ```APIDOC ## guilds - List accessible servers Prints all servers (guilds) the token can access, including the Direct Messages pseudo-guild. ### Method ```console ./DiscordChatExporter.Cli guilds -t "YOUR_TOKEN" ``` ### Parameters * **-t, --token** (string) - Required - Your Discord user or bot token. ``` -------------------------------- ### Export Channel with Custom Filename Template Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports a channel with a custom filename pattern using template tokens like %G (server name), %T (category name), and %C (channel name). ```console ./DiscordChatExporter.Cli export -t "YOUR_TOKEN" -c 123456789012345678 \ -o "/exports/%G/%T/%C.html" ``` -------------------------------- ### Export All Accessible Channels Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports all channels accessible by the token, including server channels and DMs. Specify the output directory with -o. ```console ./DiscordChatExporter.Cli exportall -t "YOUR_TOKEN" -o "/exports/" ``` -------------------------------- ### Export Server Channels with Threads and JSON Output Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports all channels in a server, including all threads (active and archived), and outputs in JSON format. Use --include-threads all and -f Json. ```console ./DiscordChatExporter.Cli exportguild -t "YOUR_TOKEN" -g 869237470565392384 \ --include-threads all -f Json -o "/exports/" ``` -------------------------------- ### Set Discord Token using User Secrets Source: https://github.com/tyrrrz/discordchatexporter/blob/prime/DiscordChatExporter.Cli.Tests/Readme.md Configure your Discord authentication token using the .NET user secrets command. This is a prerequisite for running the local test suite. ```bash dotnet user-secrets set DISCORD_TOKEN ``` -------------------------------- ### exportall Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports every channel accessible to the token, including both server channels and DMs. ```APIDOC ## exportall — Export all accessible channels ### Description Exports every channel accessible to the token, including both server channels and DMs. Can be scoped to a Discord data package ZIP to export only channels referenced in the package. ### Method CLI Command ### Endpoint `./DiscordChatExporter.Cli exportall` ### Parameters #### Path Parameters None #### Query Parameters - **-t, --token** (string) - Required - Your Discord user or bot token. - **-o, --output** (string) - Required - The path to the output directory. - **--include-dm** (boolean) - Optional - Whether to include direct message channels. Defaults to true. - **--include-vc** (boolean) - Optional - Whether to include voice channels. Defaults to true. ### Request Example ```console ./DiscordChatExporter.Cli exportall -t "YOUR_TOKEN" -o "/exports/" --include-dm false ``` ### Response #### Success Response Console output indicating the progress and success of exporting all accessible channels. #### Response Example (No specific example provided in source, but would be similar to other export commands.) ``` -------------------------------- ### Export all channels from a personal data package Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt This command exports all channels from a provided Discord data package zip file. ```APIDOC ## exportall - Export all channels from a personal data package This command exports all channels from a provided Discord data package zip file. ### Method ```console ./DiscordChatExporter.Cli exportall -t "YOUR_TOKEN" --data-package "/path/to/package.zip" -o "/exports/" ``` ### Parameters * **-t, --token** (string) - Required - Your Discord user or bot token. * **--data-package** (string) - Required - Path to the Discord data package zip file. * **-o, --output** (string) - Required - The directory where exports will be saved. ``` -------------------------------- ### exportguild Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports all accessible channels within a specified Discord server. ```APIDOC ## exportguild — Export all channels in a server ### Description Exports every accessible (non-category) channel from the specified Discord server. Voice channels are included by default and can be excluded. ### Method CLI Command ### Endpoint `./DiscordChatExporter.Cli exportguild` ### Parameters #### Path Parameters None #### Query Parameters - **-t, --token** (string) - Required - Your Discord user or bot token. - **-g, --guild** (string) - Required - The ID of the server (guild) to export. - **-f, --format** (string) - Optional - The output format (e.g., Html, Json, Csv, PlainText). Defaults to Html. - **-o, --output** (string) - Optional - The path to the output file or directory. - **--include-vc** (boolean) - Optional - Whether to include voice channels. Defaults to true. - **--include-threads** (string) - Optional - Whether to include threads. Options: `all`, `archived`, `none`. ### Request Example ```console ./DiscordChatExporter.Cli exportguild -t "YOUR_TOKEN" -g 869237470565392384 --include-vc false -f Json ``` ### Response #### Success Response Console output indicating the number of channels fetched and exported. #### Response Example ```console Fetching channels... Fetched 42 channel(s). Exporting 42 channel(s)... Successfully exported 41 channel(s). ``` ``` -------------------------------- ### List channels in a server Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Lists all channels within a specified Discord server. You can filter by channel type (e.g., exclude voice channels) and include threads. The output can be redirected to a file for later processing. ```bash # List all channels (including voice) in a server ./DiscordChatExporter.Cli channels -t "YOUR_TOKEN" -g 869237470565392384 ``` ```bash # List text channels only, including active threads ./DiscordChatExporter.Cli channels -t "YOUR_TOKEN" -g 869237470565392384 \ --include-vc false --include-threads active ``` ```bash # Redirect output to a file for later use ./DiscordChatExporter.Cli channels -t "YOUR_TOKEN" -g 869237470565392384 \ > channels.txt ``` -------------------------------- ### Export Discord Chat with Docker on SELinux Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Use this command to export Discord chat history using the Docker image. Ensure the volume mount path is correctly specified and suffixed with ':z' for SELinux compatibility. ```bash docker run --rm \ -v /path/to/exports:/out:z \ tyrrrz/discordchatexporter:stable \ export -t "YOUR_TOKEN" -c 123456789012345678 ``` -------------------------------- ### Export All Direct Message Channels to HTML Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports all direct message (DM) and group DM channels to HTML files using the default dark theme. Specify the output directory with -o. ```console ./DiscordChatExporter.Cli exportdm -t "YOUR_TOKEN" -o "/exports/dms/" ``` -------------------------------- ### Export Channel with User and Media Filters Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports messages from a specific user that contain images. Use the --filter flag with 'from:' and 'has:' operators. ```console ./DiscordChatExporter.Cli export -t "YOUR_TOKEN" -c 123456789012345678 \ --filter "from:SomeUser has:image" ``` -------------------------------- ### Export All Channels Excluding Voice Channels Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports all channels but excludes voice channels. Use the --include-vc false flag. ```console ./DiscordChatExporter.Cli exportall -t "YOUR_TOKEN" --include-vc false -o "/exports/" ``` -------------------------------- ### Export Single Channel to HTML Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports a single Discord channel to an HTML file using the default dark theme. Requires a user or bot token and the channel ID. ```console ./DiscordChatExporter.Cli export -t "YOUR_TOKEN" -c 123456789012345678 ``` -------------------------------- ### Export Server Channels Excluding Voice, Plain Text Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports all channels in a server, excluding voice channels, and outputs in plain text format. Use --include-vc false and -f PlainText. ```console ./DiscordChatExporter.Cli exportguild -t "YOUR_TOKEN" -g 869237470565392384 \ --include-vc false -f PlainText -o "/exports/" ``` -------------------------------- ### Partition exports by message count or file size Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Splits large exports into multiple files based on a specified message count or file size limit. This helps manage file sizes and organization for extensive chat logs. ```bash # Split after every 500 messages ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID -p 500 ``` ```bash # Split by file size: 20 MB per part ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID -p 20mb ``` ```bash # Split by 1 GB per part ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID -p 1gb ``` -------------------------------- ### Export Channel with Date Range Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports messages from a specific channel within a defined date range. Use --after and --before flags with YYYY-MM-DD format. ```console ./DiscordChatExporter.Cli export -t "YOUR_TOKEN" -c 123456789012345678 \ --after "2023-01-01" --before "2023-12-31" ``` -------------------------------- ### Customize date/time formatting with locale and UTC Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Use `--locale` with BCP 47 tags to format dates and times according to a specific language. The `--utc` flag converts all timestamps to UTC+0. ```console # Use German locale formatting ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID --locale "de-DE" ``` ```console # Normalize all timestamps to UTC ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID --utc ``` ```console # Japanese locale with UTC normalization ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --locale "ja-JP" --utc ``` -------------------------------- ### Export All Channels in a Server Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports all accessible channels within a specified Discord server. Requires a token and server ID (-g). ```console ./DiscordChatExporter.Cli exportguild -t "YOUR_TOKEN" -g 869237470565392384 ``` -------------------------------- ### Export All Channels Excluding DMs Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports all server channels but excludes direct message channels. Use the --include-dm false flag. ```console ./DiscordChatExporter.Cli exportall -t "YOUR_TOKEN" --include-dm false -o "/exports/" ``` -------------------------------- ### Export Channel to JSON Format Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports a Discord channel to a JSON file. Specify the output format using the -f flag. ```console ./DiscordChatExporter.Cli export -t "YOUR_TOKEN" -c 123456789012345678 -f Json ``` -------------------------------- ### Export DMs to CSV with Date Range Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports all DMs to CSV format, filtering messages within a specific date range. Use --after and --before flags. ```console ./DiscordChatExporter.Cli exportdm -t "YOUR_TOKEN" -f Csv \ --after "2024-01-01" --before "2024-06-01" \ -o "/exports/dms/" ``` -------------------------------- ### List direct message channels Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Prints all DM and group DM channels available to the authenticated account, sorted by most recent message. ```APIDOC ## dm - List direct message channels Prints all DM and group DM channels available to the authenticated account, sorted by most recent message. ### Method ```console ./DiscordChatExporter.Cli dm -t "YOUR_TOKEN" ``` ### Parameters * **-t, --token** (string) - Required - Your Discord user or bot token. ``` -------------------------------- ### export Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports one or more specific channels by ID. Supports various filters, output formats, and media handling options. ```APIDOC ## export — Export one or more specific channels ### Description Exports one or multiple channels by ID. If a category ID is provided, all channels within that category are exported. All shared export options (format, output, filters, partitioning, etc.) apply. ### Method CLI Command ### Endpoint `./DiscordChatExporter.Cli export` ### Parameters #### Path Parameters None #### Query Parameters - **-t, --token** (string) - Required - Your Discord user or bot token. - **-c, --channel** (string) - Required - The ID of the channel to export. Can be specified multiple times for multiple channels. - **-f, --format** (string) - Optional - The output format (e.g., Html, Json, Csv, PlainText). Defaults to Html. - **-o, --output** (string) - Optional - The path to the output file or directory. Supports template tokens like %G, %T, %C. - **--after** (string) - Optional - Export messages after this date (YYYY-MM-DD). - **--before** (string) - Optional - Export messages before this date (YYYY-MM-DD). - **--include-threads** (string) - Optional - Whether to include threads. Options: `all`, `archived`, `none`. - **--media** - Optional - Download all attachments and embeds. - **--reuse-media** - Optional - Reuse already downloaded media files. - **--filter** (string) - Optional - Filter messages based on criteria (e.g., `from:User has:image`). - **-p, --partition-size** (string) - Optional - Maximum size of each output file (e.g., `10mb`, `1gb`). - **--parallel** (integer) - Optional - Number of channels to export in parallel. ### Request Example ```console ./DiscordChatExporter.Cli export -t "YOUR_TOKEN" -c 123456789012345678 --after "2023-01-01" --include-threads all --media ``` ### Response #### Success Response Console output indicating the progress and success of the export. #### Response Example ```console Exporting 1 channel(s)... [====] MyServer / general 100% Successfully exported 1 channel(s). ``` ``` -------------------------------- ### Export messages within a date range Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Use `--before` and `--after` flags to specify a time window for exported messages. Accepts dates, times, or Discord message snowflake IDs. The range can be precise to milliseconds. ```console # Messages before a date ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --before "2024-01-01" ``` ```console # Messages after a date and time ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --after "2023-06-15 14:30" ``` ```console # Messages within a range (precise to milliseconds) ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --after "01-JAN-2023 00:00:00.000" --before "31-DEC-2023 23:59:59.999" ``` -------------------------------- ### List direct message channels Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Retrieves a list of all direct message and group DM channels associated with the authenticated account, ordered by the most recent message activity. ```bash # List all DM channels ./DiscordChatExporter.Cli dm -t "YOUR_TOKEN" ``` -------------------------------- ### Control thread inclusion in exports Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt The `--include-threads` option determines which threads are exported. Accepted values are `none` (default), `active`, and `all`. Use `active` for non-archived threads and `all` for both active and archived threads. ```console # Include only active (non-archived) threads ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --include-threads active ``` ```console # Include both active and archived threads ./DiscordChatExporter.Cli exportguild -t TOKEN -g GUILD_ID \ --include-threads all ``` -------------------------------- ### Filter messages by sender or content Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Use the `--filter` option with a query syntax similar to Discord's search to include specific messages. Supports sender, attachment types, and exact phrase matching. Use `~` to negate filters. ```console # Only messages from a specific user ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --filter "from:Alice" ``` ```console # Only messages with an image attachment ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --filter "has:image" ``` ```console # Messages from Alice OR Bob that contain a file ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --filter "(from:Alice | from:Bob) has:file" ``` ```console # Exact phrase match ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --filter '"hello world"' ``` ```console # Exclude messages from a user (use ~ instead of - to avoid shell parsing issues) ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --filter "~from:SpamBot" ``` ```console # Mentions a specific user and contains a video ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --filter "mentions:Alice has:video" ``` -------------------------------- ### Respect Discord Rate Limits Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt By default, DiscordChatExporter respects Discord's advisory rate limits. To ignore advisory limits and only obey hard 429 responses, set the --respect-rate-limits flag to false. This may lead to more retries. ```bash ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID ``` ```bash ./DiscordChatExporter.Cli export -t TOKEN -c CHANNEL_ID \ --respect-rate-limits false ``` -------------------------------- ### exportdm Source: https://context7.com/tyrrrz/discordchatexporter/llms.txt Exports all direct message (DM) and group DM channels accessible to the authenticated account. ```APIDOC ## exportdm — Export all direct message channels ### Description Exports all direct message (DM) and group DM channels accessible to the authenticated account. Accepts all standard export options. ### Method CLI Command ### Endpoint `./DiscordChatExporter.Cli exportdm` ### Parameters #### Path Parameters None #### Query Parameters - **-t, --token** (string) - Required - Your Discord user or bot token. - **-o, --output** (string) - Required - The path to the output directory. - **-f, --format** (string) - Optional - The output format (e.g., Html, Json, Csv, PlainText). Defaults to Html. - **--after** (string) - Optional - Export messages after this date (YYYY-MM-DD). - **--before** (string) - Optional - Export messages before this date (YYYY-MM-DD). ### Request Example ```console ./DiscordChatExporter.Cli exportdm -t "YOUR_TOKEN" -o "/exports/dms/" --after "2024-01-01" ``` ### Response #### Success Response Console output indicating the number of DM channels fetched and exported. #### Response Example ```console Fetching channels... Exporting 15 channel(s)... Successfully exported 15 channel(s). ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.