diff --git a/.docs/Docker.md b/.docs/Docker.md index 4c8ab87..848eabc 100644 --- a/.docs/Docker.md +++ b/.docs/Docker.md @@ -8,7 +8,7 @@ Note that only the CLI flavor of DiscordChatExporter is available for use with D This will download the [Docker image from the registry](https://hub.docker.com/r/tyrrrz/discordchatexporter) to your computer. You can run this command again to update when a new version is released. -``` +```console docker pull tyrrrz/discordchatexporter:stable ``` @@ -24,19 +24,19 @@ You can see all available tags [here](https://hub.docker.com/r/tyrrrz/discordcha To run the CLI in Docker and render help text: -``` +```console docker run --rm tyrrrz/discordchatexporter:stable ``` To export a channel: -``` +```console docker run --rm -v /path/on/machine:/out tyrrrz/discordchatexporter:stable export -t TOKEN -c CHANNELID ``` If you want colored output and real-time progress reporting, pass the `-it` (interactive) option: -``` +```console docker run --rm -it -v /path/on/machine:/out tyrrrz/discordchatexporter:stable export -t TOKEN -c CHANNELID ``` @@ -45,7 +45,7 @@ Note the `-v /path/on/machine:/out` option, which instructs Docker to bind the ` > **Note**: > If you are running SELinux, you will need to add the `:z` option after `/out`, e.g.: > -> ``` +> ```console > docker run --rm -v /path/on/machine:/out:z tyrrrz/discordchatexporter:stable export -t TOKEN -c CHANNELID > ``` > diff --git a/.docs/Dotnet.md b/.docs/Dotnet.md index a5a1bd8..81c0082 100644 --- a/.docs/Dotnet.md +++ b/.docs/Dotnet.md @@ -9,16 +9,16 @@ If you are using the CLI from Docker, installing the runtime on the host machine - [Windows and macOS](#windows-and-macos) - [Linux](#linux) - [Docker](#docker) -- [Verify installation](#Verify-installation-optional) +- [Verify installation](#verify-installation-optional) ## Windows and macOS -**Download from the direct links:** +**Download directly from one of the links:** -- [.NET v7.0 Runtime for **Windows x64**](https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-desktop-7.0.1-windows-x64-installer) -- [.NET v7.0 Runtime for **Windows x86**](https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-desktop-7.0.1-windows-x86-installer) -- [.NET v7.0 Runtime for **Macs with Apple silicon**](https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-7.0.1-macos-arm64-installer) -- [.NET v7.0 Runtime for **Macs with an Intel processor**](https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-7.0.1-macos-x64-installer) +- [.NET v7.0 Runtime for **Windows x64**](https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-desktop-7.0.11-windows-x64-installer) +- [.NET v7.0 Runtime for **Windows x86**](https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-desktop-7.0.11-windows-x86-installer) +- [.NET v7.0 Runtime for **Macs with Apple silicon**](https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-7.0.11-macos-arm64-installer) +- [.NET v7.0 Runtime for **Macs with an Intel processor**](https://dotnet.microsoft.com/download/dotnet/thank-you/runtime-7.0.11-macos-x64-installer) > **Note**: > [How can I tell if my computer is running a 32-bit (x86) or a 64-bit (x64) version of Windows?](https://support.microsoft.com/help/15056/windows-32-64-bit-faq) @@ -27,26 +27,26 @@ If you are using the CLI from Docker, installing the runtime on the host machine > [Is my Mac using an Intel processor or Apple silicon?](https://support.apple.com/HT211814) **Otherwise:** -[Check out the latest version in this page](https://dotnet.microsoft.com/download/dotnet/7.0). +[Check out the latest version on this page](https://dotnet.microsoft.com/download/dotnet/7.0). Look for the download link in the '**.NET Runtime**' section, under **Installers**: -[![](https://i.imgur.com/t3PB3NC.png)](https://dotnet.microsoft.com/download/dotnet/7.0) +[![Screenshot from download page](https://i.imgur.com/t3PB3NC.png)](https://dotnet.microsoft.com/download/dotnet/7.0) ## Linux -**You only need to install .NET Runtime v7.0** +Installing the .NET Runtime works differently depending on which Linux distribution you use. Check out the instructions for your distro: -- [Ubuntu](https://docs.microsoft.com/dotnet/core/install/linux-ubuntu#supported-distributions) -- [Debian](https://docs.microsoft.com/dotnet/core/install/linux-debian#supported-distributions) -- [Fedora](https://docs.microsoft.com/dotnet/core/install/linux-fedora#supported-distributions) +- [Ubuntu](https://docs.microsoft.com/dotnet/core/install/linux-ubuntu) +- [Debian](https://docs.microsoft.com/dotnet/core/install/linux-debian) +- [Fedora](https://docs.microsoft.com/dotnet/core/install/linux-fedora) For other distros, please check the _'Install on Linux'_ menu on the left of [this page](https://docs.microsoft.com/dotnet/core/install/linux). ## Docker -Installing .NET Runtime is not needed. Please refer to the [Docker usage instructions](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Docker.md) page for more information. +Installing the .NET Runtime is not needed. Please refer to the [Docker usage instructions](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Docker.md) page for more information. ## Verify installation (optional) @@ -55,15 +55,16 @@ You can check which version of **.NET Runtime** is installed by following these ### Step 1 **Windows:** Open Command Prompt (aka `cmd`) + **macOS and Linux:** Open `Terminal` ### Step 2 -Run: `dotnet --info` -If **.NET Runtime** is correctly installed, the command will output the following: +Run `dotnet --info` -``` +If the **.NET Runtime** is correctly installed, the command will output the following: +```console .NET runtimes installed: Microsoft.NETCore.App 7.0.x [C:\path\to\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 7.0.x [C:\path\to\dotnet\shared\Microsoft.WindowsDesktop.App] diff --git a/.docs/Getting-started.md b/.docs/Getting-started.md index 17bdeee..7fd7e93 100644 --- a/.docs/Getting-started.md +++ b/.docs/Getting-started.md @@ -10,7 +10,7 @@ The information presented on this page is valid for **all** platforms. ## GUI or CLI? -![](https://i.imgur.com/j9OTxRB.png) +![GUI vs CLI](https://i.imgur.com/j9OTxRB.png) **DCE** has two different versions: - **Graphical User Interface** (**GUI**) - it's the preferred version for newcomers as it is easy to use. @@ -21,447 +21,10 @@ The information presented on this page is valid for **all** platforms. If you're not comfortable with **Windows'** Command-line (cmd), please choose the GUI. [**macOS**](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/MacOS.md), [**Linux**](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Linux.md) and [**Docker**](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Docker.md) users can only use the CLI version. -**(Skip to [Using the CLI](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#using-the-cli) or [File Formats](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#file-formats))** +There are dedicated guides for each version: -## Using the GUI - -### Video tutorial - -[![Video tutorial](https://i.ytimg.com/vi/jjtu0VQXV7I/hqdefault.jpg)](https://youtube.com/watch?v=jjtu0VQXV7I) - -> Video by [NoIntro Tutorials](https://youtube.com/channel/UCFezKSxdNKJe77-hYiuXu3Q). - -### Guide - -1. After extracting the `.zip`, open `DiscordChatExporter.exe` -2. Please refer to the on-screen instructions to get your token, then paste your token in the upper text box and hit ENTER or click the arrow (→). - -> **Warning**: -> **Never share your token!** -> A token gives full access to an account, treat it like a password. - - - -3. DCE will display your Direct Messages and a sidebar with your server list. Select the channel you would like to export, then click the ![](https://i.imgur.com/dnTOlDa.png) button to continue. - -> **Note**: -> You can export multiple channels at once by holding `CTRL` or `SHIFT` while selecting. -> You can also double-click a channel to export it without clicking the ![](https://i.imgur.com/dnTOlDa.png) button. - - - -4. In this screen you can customize the following: - -- **Export format** - HTML (Dark), HTML (Light), TXT, CSV and JSON - -Click the menu button (☰) to see more options: - -- **Date range (after/before)** (Optional) - If set, only messages sent in the provided date range will be exported. Only one value (either after or before) is required if you want to use this option. - > **Note**: - > Please note that the time defaults to **12:00 AM** (midnight/00:00). This means that if you choose to export between Sep 17th and Sep 18th, messages from Sep 18th won't be exported. -- **Filter** (Optional) - Special notation for filtering the messages that get included in the export. See [Message filters](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Message-filters.md) for more info. -- **Messages per partition** (Optional) - Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb). For example, a channel with 36 messages set to be partitioned every 10 messages will output 4 files. -- **Download assets** (Optional) - If this option is set, the export will include additional files such as user avatars, attached files, images, etc. - Only files that are referenced by the export are downloaded, which means that, for example, user avatars will not be downloaded when using the plain text (TXT) export format. - A folder containing the assets will be created along with the exported chat. They must be kept together. - -5. Click `EXPORT` to export. - - - -### Settings - -**Auto-updates** -Perform automatic updates on every launch. -Default: Enabled - -> **Note**: -> Keep this option enabled to receive the latest features and bug fixes! - -**Dark mode** -Use darker colors in the UI (User Interface). -Default: Disabled - -**Save token** -Persist last used token between sessions. -Default: Enabled - -**Reuse downloaded assets** -Reuse already downloaded assets to skip redundant requests. -Default: Disabled - -**Date format** -You can customize how dates are formatted in the exported files in the settings menu (). - -- The default one is `17-Sep-19 11:34 PM` - `dd-MMM-yy hh:mm tt` -- To change it to `09-17-19 11:34 PM` use `MM-dd-yy hh:mm tt` -- To change it to `17/09/2019 23:34` use `dd/MM/yyyy HH:mm` -- To change it to `2019-09-17 23:34:05.6534` use `yyyy-MM-dd HH:mm:ss.ffff` -- To change it to UTC `2019-09-18 04:34:05Z` use `u` -- To display the time zone, add `K`. E.g. to change it to `17-Sep-19 11:34 PM (UTC-05:00)` use `dd-MMM-yy hh:mm tt (UTCK)` -- To change it to Unix time `1568694845` use `unix` -- To change it to Unix time in milliseconds `1568694845653` use `unixms` - -More info about .NET date formats [here](https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings). - -**Parallel limit** -The number of channels can be exported at the same time. -Default: 1 - -> **Note**: -> Try to keep this number low so that your account doesn't get flagged. - -**(Skip to [File Formats](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#file-formats))** - -## Using the CLI - -> **Note**: -> Make sure you have [.NET Core installed](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Dotnet.md) before attempting to run the commands below. -> **Docker** users, please refer to the [Docker usage instructions](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Docker.md). - -1. After extracting the `.zip`, open Command Prompt, aka `cmd` (`Terminal` on **macOS** and **Linux**). - -2. Change the current directory to DCE's folder with `cd C:\path\to\directory`, then press ENTER to run the command. - -**Windows** users can quickly get the directory's path by clicking the address bar while inside the folder. -![](https://i.imgur.com/XncnhC2.gif) -**macOS** users can select the `.exe`, hit Command+I (⌘I), and copy what's after `Where:` to get the directory -![](https://camo.githubusercontent.com/3c51a904b0099c9f68a4797461d4a7914902fc04/68747470733a2f2f692e696d6775722e636f6d2f323975364e79782e706e67) -You can also drag and drop the folder on **every platform**. -![](https://i.imgur.com/sOpZQAb.gif) - -3. Now we're ready to run the commands. The examples on this page follow the Windows file path format, change the file paths according to your system. - -Let's do the following to list DCE's options: - -Type the following in Command Prompt (Terminal), then press ENTER to run it: - -```powershell -dotnet DiscordChatExporter.Cli.dll -``` - -> **Docker** users, please refer to the [Docker usage instructions](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Docker.md). - -### DCE.CLI commands - -| Command | Description | -| ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | -| [export](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#export) | Exports a channel | -| [exportdm](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#exportdm) | Exports all direct message channels | -| [exportguild](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#exportguild) | Exports all channels within the specified server | -| [exportall](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#exportall) | Exports all accessible channels | -| [channels](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#channels) | Outputs the list of channels in the given server | -| [dm](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#dm) | Outputs the list of direct message channels | -| [guilds](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#guilds) | Outputs the list of accessible servers | -| [guide](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#guide) | Explains how to obtain token, guild, and channel ID | - -To use the commands, you'll need a token. For the instructions on how to get a token, please refer to [this page](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md), or run `dotnet DiscordChatExporter.Cli.dll guide`. -To get help with a specific command, please run: - -```powershell -dotnet DiscordChatExporter.Cli.dll command -h -``` - -#### `export` - -| | Option | Description | -| ------ | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **\*** | [-c](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Channel ID(s)](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-guild-id-or-guild-channel-id) | -| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | -| | [-o](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-output-filename) | Output file or directory path | -| | [-f](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-format) | [Output file format](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#file-formats). Default: HtmlDark | -| | [--after](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#date-ranges) | Only include messages sent after this date | -| | [--before](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#date-ranges) | Only include messages sent before this date | -| | [-p](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#partitioning) | Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb) | -| | [--filter](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Message-filters.md) | Special notation for filtering the messages that get included in the export | -| | [--media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#Downloading-assets) | Download assets referenced by the export (user avatars, attached files, embedded images, etc.). Default: false | -| | [--reuse-media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#Reuse-assets) | Reuse previously downloaded assets to avoid redundant requests. Default: false. | -| | [--dateformat](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#date-formats) | Format used when writing dates. | -| | -h | Shows help text | - -> **Note**: -> Options with an asterisk (**\***) are required. The order of the options doesn't matter. - -With this command you can export Server Channels and Direct Messages. - -##### Basic usage - -You can quickly export with DCE's default settings by using just `-t token` and `-c channelid`. - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -``` - -##### Changing the format - -You can change the export format to `HtmlDark`, `HtmlLight`, `PlainText` `Json` or `Csv` with `-f format`. The default format is `HtmlDark`. - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -f Json -``` - -##### Changing the output filename - -You can change the filename by using `-o name.ext`. e.g. for the `HTML` format: - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -o myserver.html -``` - -##### Changing the output directory - -You can change the export directory by using `-o` and providing a path that ends with a slash or does not have a file extension. -If any of the folders in the path have a space in its name, escape them with quotes ("). - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -o "C:\Discord Exports" -``` - -##### Changing the filename and output directory - -You can change both the filename and export directory by using `-o directory\name.ext`. -Note that the filename must have an extension, otherwise it will be considered a directory name. -If any of the folders in the path have a space in its name, escape them with quotes ("). - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -o "C:\Discord Exports\myserver.html" -``` - -##### Generating the filename and output directory dynamically - -You can use template tokens to generate the output file path based on the guild and channel metadata. - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -o "C:\Discord Exports\%G\%T\%C.html" -``` - -Assuming you are exporting a channel named `"my-channel"` in the `"Text channels"` category from a server called `"My server"`, you will get the following output file path: `C:\Discord Exports\My server\Text channels\my-channel.html` - -Here is the full list of supported template tokens: - -- `%g` - guild ID -- `%G` - guild name -- `%t` - category ID -- `%T` - category name -- `%c` - channel ID -- `%C` - channel name -- `%p` - channel position -- `%P` - category position -- `%a` - the "after" date -- `%b` - the "before" date -- `%%` - escapes `%` - -##### Partitioning - -You can use partitioning to split files after a given number of messages or file size. -For example, a channel with 36 messages set to be partitioned every 10 messages will output 4 files. - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -p 10 -``` - -A 45mb channel set to be partitioned every 20mb will output 3 files. - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -p 20mb -``` - -##### Downloading assets - -If this option is set, the export will include additional files such as user avatars, attached files, images, etc. -Only files that are referenced by the export are downloaded, which means that, for example, user avatars will not be downloaded when using the plain text (TXT) export format. -A folder containing the assets will be created along with the exported chat. They must be kept together. - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --media -``` - -##### Reuse assets - -Previously downloaded assets can be reused to skip redundant downloads as long as the chat is always exported to the same folder. Using this option can speed up future exports. This option requires the `--media` option. - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --media --reuse-media -``` - -##### Date formats - -This setting changes how dates are formatted in the exported files. - -- The default one is `17-Sep-19 11:34 PM` - `dd-MMM-yy hh:mm tt` -- To change it to `09-17-19 11:34 PM` use `MM-dd-yy hh:mm tt` -- To change it to `17/09/2019 23:34` use `dd/MM/yyyy HH:mm` -- To change it to `2019-09-17 23:34:05.6534` use `yyyy-MM-dd HH:mm:ss.ffff` -- To change it to UTC `2019-09-18 04:34:05Z` use `u` -- To display the time zone, add `K`. E.g. to change it to `17-Sep-19 11:34 PM (UTC-05:00)` use `dd-MMM-yy hh:mm tt (UTCK)` -- To change it to Unix time `1568694845` use `unix` -- To change it to Unix time in milliseconds `1568694845653` use `unixms` - -More info about .NET date formats [here](https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings). - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --dateformat "yyyy-MM-dd HH:mm" -``` - -> Special thanks to [@andrewkolos](https://github.com/andrewkolos) for adding the Unix options - -##### Date ranges - -**Messages sent before a date** -Use `--before` to export messages sent before the provided date. E.g. messages sent before September 18th, 2019: - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --before 2019-09-18 -``` - -**Messages sent after a date** -Use `--after` to export messages sent after the provided date. E.g. messages sent after September 17th, 2019 11:34 PM: - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --after "2019-09-17 23:34" -``` - -**Messages sent in a date range** -Use `--before` and `--after` to export messages sent during the provided date range. E.g. messages sent between September 17th, 2019 11:34 PM and September 18th: - -```powershell -dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --after "2019-09-17 23:34" --before "2019-09-18" -``` - -You can try different formats like `17-SEP-2019 11:34 PM` or even refine your ranges down to milliseconds `17-SEP-2019 23:45:30.6170`! -Don't forget to quote (") the date if it has spaces! -More info about .NET date formats [here](https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings). - -#### `exportdm` - -| | Option | Description | -| ------ | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | -| | --parallel | Limits how many channels can be exported in parallel. Try to keep this number low so that your account doesn't get flagged. Default: 1 | -| | [-o](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-output-filename) | Output file or directory path | -| | [-f](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-format) | [Output file format](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#file-formats). Default: HtmlDark | -| | [--after](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#date-ranges) | Only include messages sent after this date | -| | [--before](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#date-ranges) | Only include messages sent before this date | -| | [-p](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#partitioning) | Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb) | -| | [--filter](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Message-filters.md) | Special notation for filtering the messages that get included in the export | -| | [--media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#Downloading-assets) | Download assets referenced by the export (user avatars, attached files, embedded images, etc.). Default: false | -| | [--reuse-media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#Reuse-assets) | Reuse previously downloaded assets to avoid redundant requests. Default: false. | -| | [--dateformat](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#date-formats) | Date format used in output | -| | -h | Shows help text | - -> **Note**: -> Options with an asterisk (**\***) are required. The order of the options doesn't matter. - -This command exports all your Direct Messages. - -#### `exportguild` - -| | Option | Description | -| ------ | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **\*** | -g | [Server ID](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-guild-id-or-guild-channel-id) | -| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | -| | --parallel | Limits how many channels can be exported in parallel. Try to keep this number low so that your account doesn't get flagged. Default: 1 | -| | [-o](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-output-filename) | Output file or directory path | -| | [-f](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-format) | [Output file format](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#file-formats). Default: HtmlDark | -| | [--after](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#date-ranges) | Only include messages sent after this date | -| | [--before](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#date-ranges) | Only include messages sent before this date | -| | [-p](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#partitioning) | Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb) | -| | [--filter](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Message-filters.md) | Special notation for filtering the messages that get included in the export | -| | [--media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#Downloading-assets) | Download assets referenced by the export (user avatars, attached files, embedded images, etc.). Default: false | -| | [--reuse-media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#Reuse-assets) | Reuse previously downloaded assets to avoid redundant requests. Default: false. | -| | [--dateformat](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#date-formats) | Date format used in output | -| | -h | Shows help text | - -> **Note**: -> Options with an asterisk (**\***) are required. The order of the options doesn't matter. - -This command exports all channels of a Server. - -#### `exportall` - -| | Option | Description | -| ------ | --------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | -| | --include-dm | Include direct message channels. Default: true | -| | --parallel | Limits how many channels can be exported in parallel. Try to keep this number low so that your account doesn't get flagged. Default: 1 | -| | [-o](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-output-filename) | Output file or directory path | -| | [-f](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-format) | [Output file format](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#file-formats). Default: HtmlDark | -| | [--after](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#date-ranges) | Only include messages sent after this date | -| | [--before](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#date-ranges) | Only include messages sent before this date | -| | [-p](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#partitioning) | Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb) | -| | [--filter](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Message-filters.md) | Special notation for filtering the messages that get included in the export | -| | [--media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#Downloading-assets) | Download assets referenced by the export (user avatars, attached files, embedded images, etc.). Default: false | -| | [--reuse-media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#Reuse-assets) | Reuse previously downloaded assets to avoid redundant requests. Default: false. | -| | [--dateformat](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#date-formats) | Date format used in output | -| | -h | Shows help text | - -> **Note**: -> Options with an asterisk (**\***) are required. The order of the options doesn't matter. - -This command exports all accessible channels, including server channels and DMs. - -To exclude DMs, add the `--include-dm false` option: - -```powershell -dotnet DiscordChatExporter.Cli.dll exportall -t "mfa.Ifrn" --include-dm false -``` - -#### `channels` - -| | Option | Description | -| ------ | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **\*** | -g | [Server ID](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-guild-id-or-guild-channel-id) | -| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | -| | -h | Shows help text | - -> **Note**: -> Options with an asterisk (**\***) are required. The order of the options doesn't matter. - -This command outputs the server channels in the following format: -`Channel ID | Channel Name` -To save the output to a file, run the command below. If the file already exists, it will be overwritten. - -```powershell -dotnet DiscordChatExporter.Cli.dll channels -t "mfa.Ifrn" -g 21814 > C:\path\to\output.txt -``` - -#### `dm` - -| | Option | Description | -| ------ | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | -| | -h | Shows help text | - -> **Note**: -> Options with an asterisk (**\***) are required. The order of the options doesn't matter. - -This command outputs the list of Direct Messages. -To save the output to a file, run the command with `> C:\path\…` like the example below. If the file already exists, it will be overwritten. - -```powershell -dotnet DiscordChatExporter.Cli.dll dm -t "mfa.Ifrn" > C:\path\to\output.txt -``` - -#### `guilds` - -| | Option | Description | -| ------ | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | -| | -h | Shows help text | - -> **Note**: -> Options with an asterisk (**\***) are required. The order of the options doesn't matter. - -This command outputs a list of your Server List. -To save the output to a file, run the command with `> C:\path\…` like the example below. If the file already exists, it will be overwritten. - -```powershell -dotnet DiscordChatExporter.Cli.dll guilds -t "mfa.Ifrn" > C:\path\to\output.txt -``` - -#### `guide` - -This command explains [how to get your token, guild, and channel IDs](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md). +- [Using the GUI](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-GUI.md) +- [Using the CLI](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md) ## File formats @@ -497,10 +60,3 @@ You can open `.json` files with a text editor, such as Notepad. The CSV format allows for easy parsing of the chat log. Depending on your needs, the JSON format might be better. You can open `.csv` files with a text editor, such as Notepad, or a spreadsheet app, like Microsoft Excel and Google Sheets. - -**([Back to top](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#getting-started))** - ---- - -Further reading: [.NET date formats](https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings) -Special thanks to [@Yudi](https://github.com/Yudi) diff --git a/.docs/Linux.md b/.docs/Linux.md index b0cf3fd..ceac3fc 100644 --- a/.docs/Linux.md +++ b/.docs/Linux.md @@ -11,7 +11,7 @@ Please follow the [instructions provided here](https://github.com/Tyrrrz/Discord 3. `cd` into the extracted folder. You can do this in Terminal by typing `cd`, then press the SPACE key, drag and drop the extracted folder into the Terminal window, and press the ENTER key. 4. Replace `TOKEN` and `CHANNEL`, then execute this command to export: -``` +```console dotnet DiscordChatExporter.Cli.dll export -t TOKEN -c CHANNEL ``` diff --git a/.docs/MacOS.md b/.docs/MacOS.md index 7d1721a..b545f17 100644 --- a/.docs/MacOS.md +++ b/.docs/MacOS.md @@ -13,7 +13,7 @@ Please follow the [instructions provided here](https://github.com/Tyrrrz/Discord 3. In the Terminal window, type `cd` , press the SPACE key, then drag and drop the extracted folder into the window, then press the RETURN key. 4. Execute the following command to export, replacing `TOKEN` and `CHANNEL` with your own values: -``` +```console dotnet DiscordChatExporter.Cli.dll export -t TOKEN -c CHANNEL ``` diff --git a/.docs/Message-filters.md b/.docs/Message-filters.md index 521b2d6..4d917d3 100644 --- a/.docs/Message-filters.md +++ b/.docs/Message-filters.md @@ -8,79 +8,79 @@ To configure a filter, specify it in advanced export parameters when using the G - Filter by user -``` +```console from:Tyrrrz ``` - Filter by user (with discriminator) -``` +```console from:Tyrrrz#1234 ``` - Filter by message content (allowed values: `link`, `embed`, `file`, `video`, `image`, `sound`) -``` +```console has:image ``` - Filter by mentioned user (same rules apply as with `from:` filter) -``` +```console mentions:Tyrrrz#1234 ``` - Filter by contained text (has word "hello" and word "world" somewhere in the message text): -``` +```console hello world ``` - Filter by contained text (has the string "hello world" somewhere in the message text): -``` +```console "hello world" ``` - Combine multiple filters ('and'): -``` +```console from:Tyrrrz has:image ``` - Same thing but with an explicit operator: -``` +```console from:Tyrrrz & has:image ``` - Combine multiple filters ('or'): -``` +```console from:Tyrrrz | from:"96-LB" ``` - Combine multiple filters using groups: -``` +```console (from:Tyrrrz | from:"96-LB") has:image ``` - Negate a filter: -``` +```console -from:Tyrrrz | -has:image ``` - Negate a grouped filter: -``` +```console -(from:Tyrrrz has:image) ``` - Escape special characters (`-` is escaped below, so it's not parsed as negation operator): -``` +```console from:96\-LB ``` @@ -88,18 +88,18 @@ from:96\-LB In most cases, you will need to enclose your filter in quotes (`"`) to escape characters that may have special meaning in your shell: -``` +```console DiscordChatExporter.Cli export [...] --filter "from:Tyrrrz has:image" ``` If you need to include quotes inside the filter itself as well, use single quotes (`'`) for those instead: -``` +```console DiscordChatExporter.Cli export [...] --filter "from:Tyrrrz 'hello world'" ``` Additionally, negated filters (those that start with `-`) may cause parsing issues even when enclosed in quotes. To avoid this, use the tilde (`~`) character instead of the dash (`-`): -``` +```console DiscordChatExporter.Cli export [...] --filter ~from:Tyrrrz -``` \ No newline at end of file +``` diff --git a/.docs/Scheduling-Linux.md b/.docs/Scheduling-Linux.md index 9123e84..6e9c650 100644 --- a/.docs/Scheduling-Linux.md +++ b/.docs/Scheduling-Linux.md @@ -108,7 +108,7 @@ Verify your cron time [here](https://crontab.guru). --- -**Extra information** +**Additional information** The week starts on Sunday. 0 = SUN, 1 = MON ... 7 = SUN. diff --git a/.docs/Scheduling-MacOS.md b/.docs/Scheduling-MacOS.md index 7604fc1..8083f76 100644 --- a/.docs/Scheduling-MacOS.md +++ b/.docs/Scheduling-MacOS.md @@ -88,7 +88,7 @@ After copying and pasting, make sure the file/folder name is not missing. If a f - `/Users/user/Documents/Discord\ Exports` - Correct ✓ - `/Users/user/Desktop/DiscordChatExporter` - Correct ✓ -![](https://i.imgur.com/29u6Nyx.png) +![Screenshot of mac info window](https://i.imgur.com/29u6Nyx.png) 5. Save the file as `filename.sh`, not `.txt` 6. Open Terminal.app, type `chmod +x`, press the SPACE key, then drag & drop the `filename.sh` into the Terminal window and hit RETURN. You may be prompted for your password, and you won't be able to see it as you type. @@ -101,13 +101,13 @@ Open TextEdit, make a Plain Text (⇧⌘T) and then paste the following into it: - - Label - local.discordchatexporter - Program - /path/to/filename.sh - REPLACEME - + + Label + local.discordchatexporter + Program + /path/to/filename.sh + REPLACEME + ``` @@ -138,16 +138,16 @@ The following example is to export every 3600 seconds (1 hour), replace the inte ```xml StartCalendarInterval - Weekday - 0 - Month - 0 - Day - 0 - Hour - 0 - Minute - 0 + Weekday + 0 + Month + 0 + Day + 0 + Hour + 0 + Minute + 0 ``` @@ -175,10 +175,10 @@ Export everyday at 5:15 PM: ```xml StartCalendarInterval - Hour - 17 - Minute - 15 + Hour + 17 + Minute + 15 ``` @@ -188,8 +188,8 @@ Every 15 minutes of an hour (xx:15): ```xml StartCalendarInterval - Minute - 15 + Minute + 15 ``` @@ -199,20 +199,20 @@ Every Sunday at midnight and every Wednesday full hour (xx:00). Notice the inclu ```xml StartCalendarInterval - - Weekday - 0 - Hour - 00 - Minute - 00 - - - Weekday - 3 - Minute - 00 - + + Weekday + 0 + Hour + 00 + Minute + 00 + + + Weekday + 3 + Minute + 00 + ``` diff --git a/.docs/Scheduling-Windows.md b/.docs/Scheduling-Windows.md index 78eb0b3..3822198 100644 --- a/.docs/Scheduling-Windows.md +++ b/.docs/Scheduling-Windows.md @@ -4,7 +4,7 @@ We'll be using [DiscordChatExporter CLI](https://github.com/Tyrrrz/DiscordChatEx 1. Open a text editor such as Notepad and paste: -```powershell +```console # Info: https://github.com/Tyrrrz/DiscordChatExporter/wiki $TOKEN = "tokenhere" @@ -40,7 +40,9 @@ exit Make sure not to delete the quotes (") -3. Save the file as `filename.ps1` not `.txt` +3. Save the file as `filename.ps1`, not as `.txt` + +> **Note**: You can also modify the script to use other options, such as `include-threads` or switch to a different command, e. g. `exportguild`. ## Export at Startup @@ -49,14 +51,14 @@ Make sure not to delete the quotes (") ## Scheduling with Task Scheduler -Please notice your computer must be turned on so the exportation can occur. +Please note that your computer must be turned on for the export to happen. 1. Press Windows + R, type `taskschd.msc` and press ENTER 2. Select `Task Scheduler Library`, create a Basic Task, and follow the instructions on-screen -[ ![](https://i.imgur.com/m2DKhA8.png) ](https://i.imgur.com/3gHkF0t.png) +![Screenshot from Task Scheduler](https://i.imgur.com/m2DKhA8.png) 3. At 'Start a Program', write `powershell -file -ExecutionPolicy ByPass -WindowStyle Hidden "C:\path\to\filename.ps1"` in the Program/script text box diff --git a/.docs/Token-and-IDs.md b/.docs/Token-and-IDs.md index bcebc82..596889c 100644 --- a/.docs/Token-and-IDs.md +++ b/.docs/Token-and-IDs.md @@ -14,6 +14,23 @@ Prerequisite step: Navigate to [discord.com](https://discord.com) and login. #### In Chrome +##### Using the console + +1. Press Ctrl+Shift+I (++I on macOS). Chrome's [DevTools](https://developer.chrome.com/docs/devtools/overview) tools will display. + +
+
+ +2. Click the `Console` tab. The [console](https://developer.chrome.com/docs/devtools/console/) will open. + +3. Type + + ```console + (webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken() + ``` + + into the console and press Enter. The console will display your user token. + ##### Using the network monitor 1. Press Ctrl+Shift+I (++I on macOS). Chrome's [DevTools](https://developer.chrome.com/docs/devtools/overview) tools will display. @@ -90,6 +107,23 @@ Prerequisite step: Navigate to [discord.com](https://discord.com) and login. #### In Firefox +##### Using the console + +1. Press Ctrl+Shift+K (++K on macOS). Firefox’s [web developer tools](https://firefox-source-docs.mozilla.org/devtools-user/) will display at the bottom of the window, and the [web console](https://firefox-source-docs.mozilla.org/devtools-user/console/index.html) will display. + +
+
+ +2. Click the `Console` tab. The [console](https://firefox-source-docs.mozilla.org/devtools-user/console/index.html) will open. + +1. Type + + ```console + (webpackChunkdiscord_app.push([[''],{},e=>{m=[];for(let c in e.c)m.push(e.c[c])}]),m).find(m=>m?.exports?.default?.getToken!==void 0).exports.default.getToken() + ``` + + into the console and press Enter. The console will display your user token. + ##### Using the network monitor 1. Press Ctrl+Shift+E (++E on macOS). Firefox’s [web developer tools](https://firefox-source-docs.mozilla.org/devtools-user/) will display at the bottom of the window, and the [network monitor](https://firefox-source-docs.mozilla.org/devtools-user/network_monitor/) will display. @@ -164,7 +198,7 @@ Prerequisite step: Navigate to [discord.com](https://discord.com) and login.

-### Through the desktop app / Enabling web developer tools +### Through the desktop app / enabling web developer tools #### By editing the settings file @@ -239,4 +273,4 @@ Prerequisite step: Navigate to [discord.com](https://discord.com) and login. 1. Open Discord Settings 2. Go to the **Advanced** section 3. Enable **Developer Mode** -4. Right-click on the desired server or channel and click Copy Server ID or Copy Channel ID \ No newline at end of file +4. Right-click on the desired server or channel and click **Copy Server ID** or **Copy Channel ID** diff --git a/.docs/Troubleshooting.md b/.docs/Troubleshooting.md index 18e63b4..305c695 100644 --- a/.docs/Troubleshooting.md +++ b/.docs/Troubleshooting.md @@ -6,7 +6,7 @@ Here you'll find the answers to most of the questions related to **DiscordChatEx - ❓ If you still have unanswered questions _after_ reading this page, feel free to [create a new discussion](https://github.com/Tyrrrz/DiscordChatExporter/discussions/new). - 🐞 If you have encountered a problem that's not described here, has not [been discussed before](https://github.com/Tyrrrz/DiscordChatExporter/discussions), and is not a [known issue](https://github.com/Tyrrrz/DiscordChatExporter/issues?q=is%3Aissue), please [create a new discussion](https://github.com/Tyrrrz/DiscordChatExporter/discussions/new) or [open a bug report](https://github.com/Tyrrrz/DiscordChatExporter/issues/new). Don't forget to include your platform (Windows, Mac, Linux, etc.) and a detailed description of your question/problem. -## General +## General questions ### Token stealer? @@ -46,6 +46,10 @@ Yes, and other media too. Export using the "Download media" (`--media`) option. Yes. +### Can DCE export multiple formats at once? + +No, you can only export one format at a time. + ### Can DCE recreate the exported chats in Discord? No, DCE is an exporter. @@ -54,17 +58,21 @@ No, DCE is an exporter. No, DCE is an exporter. +### Can DCE add new messages to an existing export? + +No. + ## First steps ### How can I find my token? Check the following page: [Obtaining token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md) -### When I open DCE a black window pops up quickly or nothing shows up. +### When I open DCE a black window pops up quickly or nothing shows up -If you have [.NET Core Runtime correctly installed](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Dotnet.md), you might have downloaded DCE.CLI, try [downloading the GUI](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#gui-or-cli) instead. +If you have [.NET Core Runtime correctly installed](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Dotnet.md), you might have downloaded the CLi flavor, try [downloading the GUI](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#gui-or-cli) instead. -### I can't open DCE. It sends me to a Visual Studio webpage. +### I can't open DCE, it sends me to a Visual Studio webpage Check the following page: [Installation and usage](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Readme.md#installation--usage) @@ -84,20 +92,24 @@ Check the following pages to learn how to schedule **DiscordChatExporter.CLI** r - [macOS scheduling](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/scheduling-MacOS.md) - [Linux scheduling](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/scheduling-Linux.md) -### The exported file is too large, I can't open it! +### The exported file is too large, I can't open it Try opening it with a different program, try partitioning or use a different file format, like `PlainText`. -### DCE is crashing/failing. +### DCE is crashing/failing Check the following page: [Installing .NET Core Runtime](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Dotnet.md) If you already have .NET Core installed, please check if your problem is a [known issue](https://github.com/Tyrrrz/DiscordChatExporter/issues?q=is%3Aissue) before [opening a bug report](https://github.com/Tyrrrz/DiscordChatExporter/issues/new). -### .NET Core Runtime is required. +### .NET Core Runtime is required Check the following page: [Installing .NET Core Runtime](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Dotnet.md) +### I see messages in the export, but they have no content + +Your bot is missing the 'Message Content Intent'. Go to the [Discord Developer Portal](https://discord.com/developers/applications), navigate to the 'Bot' section and enable it. + ## CLI ### How do I use the CLI? @@ -126,32 +138,32 @@ Make sure you're [copying the DM Channel ID](https://github.com/Tyrrrz/DiscordCh ## Errors -``` +```console DiscordChatExporter.Domain.Exceptions.DiscordChatExporterException: Authentication token is invalid. ... ``` ↳ Make sure the provided token is correct. -``` +```console DiscordChatExporter.Domain.Exceptions.DiscordChatExporterException: Requested resource does not exist. ``` ↳ Check your channel ID, it might be invalid. [Read this if you need help](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md). -``` +```console DiscordChatExporter.Domain.Exceptions.DiscordChatExporterException: Access is forbidden. ``` ↳ This means you don't have access to the channel. -``` +```console The application to execute does not exist: ``` ↳ The `DiscordChatExporter.Cli.dll` file is missing. Keep the `.exe` and all the `.dll` files together. If you didn't move the files, try unzipping again. -``` +```console System.Net.WebException: Error: TrustFailure ... Invalid certificate received from server. ... ``` @@ -167,5 +179,5 @@ If it still doesn't work, try mozroots: `mozroots --import --ask-remove` --- > ❓ If you still have unanswered questions, feel free to [create a new discussion](https://github.com/Tyrrrz/DiscordChatExporter/discussions/new). - +> > 🐞 If you have encountered a problem that's not described here, has not [been discussed before](https://github.com/Tyrrrz/DiscordChatExporter/discussions), and is not a [known issue](https://github.com/Tyrrrz/DiscordChatExporter/issues?q=is%3Aissue), please [create a new discussion](https://github.com/Tyrrrz/DiscordChatExporter/discussions/new) or [open a bug report](https://github.com/Tyrrrz/DiscordChatExporter/issues/new). diff --git a/.docs/Using-the-CLI.md b/.docs/Using-the-CLI.md new file mode 100644 index 0000000..5bb8bc1 --- /dev/null +++ b/.docs/Using-the-CLI.md @@ -0,0 +1,382 @@ +# Using the CLI + +## Guide + +> **Note**: +> Make sure you have [.NET Core installed](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Dotnet.md) before attempting to run the commands below. +> **Docker** users, please refer to the [Docker usage instructions](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Docker.md). + +## Step 1 + +After extracting the `.zip`, open Command Prompt, aka `cmd` (`Terminal` on **macOS** and **Linux**). + +## Step 2 + +Change the current directory to DCE's folder with `cd C:\path\to\directory`, then press ENTER to run the command. + +**Windows** users can quickly get the directory's path by clicking the address bar while inside the folder. +![Copy path from Explorer](https://i.imgur.com/XncnhC2.gif) + +**macOS** users can select the `.exe`, hit Command+I (⌘I), and copy what's after `Where:` to get the directory +![Mac info panel](https://camo.githubusercontent.com/3c51a904b0099c9f68a4797461d4a7914902fc04/68747470733a2f2f692e696d6775722e636f6d2f323975364e79782e706e67) + +You can also drag and drop the folder on **every platform**. +![Drag and drop folder](https://i.imgur.com/sOpZQAb.gif) + +## Step 3 + +Now we're ready to run the commands. The examples on this page follow the Windows file path format, change the file paths according to your system. + +Type the following in Command Prompt (Terminal), then press ENTER to run it. This will list DCE's options. + +```console +dotnet DiscordChatExporter.Cli.dll +``` + +> **Docker** users, please refer to the [Docker usage instructions](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Docker.md). + +## CLI commands + +| Command | Description | +| ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | +| [export](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#export) | Exports a channel | +| [exportdm](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#exportdm) | Exports all direct message channels | +| [exportguild](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#exportguild) | Exports all channels within the specified server | +| [exportall](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#exportall) | Exports all accessible channels | +| [channels](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#channels) | Outputs the list of channels in the given server | +| [dm](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#dm) | Outputs the list of direct message channels | +| [guilds](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#guilds) | Outputs the list of accessible servers | +| [guide](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#guide) | Explains how to obtain token, guild, and channel ID | + +To use the commands, you'll need a token. For the instructions on how to get a token, please refer to [this page](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md), or run `dotnet DiscordChatExporter.Cli.dll guide`. +To get help with a specific command, please run: + +```console +dotnet DiscordChatExporter.Cli.dll command -h +``` + +### `export` + +With this command, you can export **server channels** and **direct messages**. + +| | Option | Description | +| ------ | --------------------------------------------------------------------------------------------------------------------- | ----------- | +| **\*** | [-c](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Channel ID(s)](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-guild-id-or-guild-channel-id) | +| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | +| | [-o](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-output-filename) | Output file or directory path | +| | [-f](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-format) | [Output file format](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#file-formats). Default: HtmlDark | +| | [--after](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#date-ranges) | Only include messages sent after this date | +| | [--before](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#date-ranges) | Only include messages sent before this date | +| | [-p](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#partitioning) | Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb) | +| | [--filter](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Message-filters.md) | Special notation for filtering the messages that get included in the export | +| | [--media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#downloading-assets) | Download assets referenced by the export (user avatars, attached files, embedded images, etc.). Default: false | +| | [--reuse-media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#reuse-assets) | Reuse previously downloaded assets to avoid redundant requests. Default: false | +| | [--media-dir](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#downloading-assets) | Directory to store assets from all exported channels in the same place | +| | [--locale](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#changing-the-date-format) | Format used when writing dates. Default: en-US | +| | -h | Shows help text | + +> **Note**: +> Options with an asterisk (**\***) are required. The order of the options doesn't matter. + +#### Basic usage + +You can quickly export with DCE's default settings by using just `-t token` and `-c channelid`. + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 +``` + +#### Changing the format + +You can change the export format to `HtmlDark`, `HtmlLight`, `PlainText` `Json` or `Csv` with `-f format`. The default format is `HtmlDark`. + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -f Json +``` + +#### Changing the output filename + +You can change the filename by using `-o name.ext`. e.g. for the `HTML` format: + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -o myserver.html +``` + +#### Changing the output directory + +You can change the export directory by using `-o` and providing a path that ends with a slash or does not have a file extension. +If any of the folders in the path have a space in its name, escape them with quotes ("). + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -o "C:\Discord Exports" +``` + +#### Changing the filename and output directory + +You can change both the filename and export directory by using `-o directory\name.ext`. +Note that the filename must have an extension, otherwise it will be considered a directory name. +If any of the folders in the path have a space in its name, escape them with quotes ("). + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -o "C:\Discord Exports\myserver.html" +``` + +#### Generating the filename and output directory dynamically + +You can use template tokens to generate the output file path based on the guild and channel metadata. + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -o "C:\Discord Exports\%G\%T\%C.html" +``` + +Assuming you are exporting a channel named `"my-channel"` in the `"Text channels"` category from a server called `"My server"`, you will get the following output file path: `C:\Discord Exports\My server\Text channels\my-channel.html` + +Here is the full list of supported template tokens: + +- `%g` - guild ID +- `%G` - guild name +- `%t` - category ID +- `%T` - category name +- `%c` - channel ID +- `%C` - channel name +- `%p` - channel position +- `%P` - category position +- `%a` - the "after" date +- `%b` - the "before" date +- `%%` - escapes `%` + +#### Partitioning + +You can use partitioning to split files after a given number of messages or file size. +For example, a channel with 36 messages set to be partitioned every 10 messages will output 4 files. + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -p 10 +``` + +A 45 MB channel set to be partitioned every 20 MB will output 3 files. + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 -p 20mb +``` + +#### Downloading assets + +If this option is set, the export will include additional files such as user avatars, attached files, images, etc. +Only files that are referenced by the export are downloaded, which means that, for example, user avatars will not be downloaded when using the plain text (TXT) export format. +A folder containing the assets will be created along with the exported chat. They must be kept together. + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --media +``` + +#### Reusing assets + +Previously downloaded assets can be reused to skip redundant downloads as long as the chat is always exported to the same folder. Using this option can speed up future exports. This option requires the `--media` option. + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --media --reuse-media +``` + +#### Changing the media directory + +By default, the media directory is created alongside the exported chat. You can change this by using `--media-dir` and providing a path that ends with a slash. All of the exported media will be stored in this directory. + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --media --media-dir "C:\Discord Media" +``` + +#### Changing the date format + +You can customize how dates are formatted in the exported files by using `--locale` and inserting one of Discord's locales. The default locale is `en-US`. + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --locale "de-DE" +``` + +#### Date ranges + +**Messages sent before a date** +Use `--before` to export messages sent before the provided date. E.g. messages sent before September 18th, 2019: + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --before 2019-09-18 +``` + +**Messages sent after a date** +Use `--after` to export messages sent after the provided date. E.g. messages sent after September 17th, 2019 11:34 PM: + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --after "2019-09-17 23:34" +``` + +**Messages sent in a date range** +Use `--before` and `--after` to export messages sent during the provided date range. E.g. messages sent between September 17th, 2019 11:34 PM and September 18th: + +```console +dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --after "2019-09-17 23:34" --before "2019-09-18" +``` + +You can try different formats like `17-SEP-2019 11:34 PM` or even refine your ranges down to milliseconds `17-SEP-2019 23:45:30.6170`! +Don't forget to quote (") the date if it has spaces! +More info about .NET date formats [here](https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings). + +### `exportdm` + +This command exports all your **direct messages**. + +| | Option | Description | +| ------ | --------------------------------------------------------------------------------------------------------------------- | ----------- | +| **\*** | [-c](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Channel ID(s)](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-guild-id-or-guild-channel-id) | +| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | +| | [-o](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-output-filename) | Output file or directory path | +| | [-f](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-format) | [Output file format](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#file-formats). Default: HtmlDark | +| | [--after](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#date-ranges) | Only include messages sent after this date | +| | [--before](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#date-ranges) | Only include messages sent before this date | +| | [-p](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#partitioning) | Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb) | +| | [--filter](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Message-filters.md) | Special notation for filtering the messages that get included in the export | +| | [--media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#downloading-assets) | Download assets referenced by the export (user avatars, attached files, embedded images, etc.). Default: false | +| | [--reuse-media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#reuse-assets) | Reuse previously downloaded assets to avoid redundant requests. Default: false | +| | [--media-dir](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#downloading-assets) | Directory to store assets from all exported channels in the same place | +| | [--locale](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#changing-the-date-format) | Format used when writing dates. Default: en-US | +| | -h | Shows help text | + +> **Note**: +> Options with an asterisk (**\***) are required. The order of the options doesn't matter. + +### `exportguild` + +This command exports all channels of a **server**. + +| | Option | Description | +| ------ | ------------------------------------------------------------------------------------------------------------------------- | ----------- | +| **\*** | -g | [Server ID](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-guild-id-or-guild-channel-id) | +| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | +| | [-o](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-output-filename) | Output file or directory path | +| | [-f](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-format) | [Output file format](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#file-formats). Default: HtmlDark | +| | [--after](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#date-ranges) | Only include messages sent after this date | +| | [--before](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#date-ranges) | Only include messages sent before this date | +| | [-p](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#partitioning) | Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb) | +| | [--filter](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Message-filters.md) | Special notation for filtering the messages that get included in the export | +| | [--media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#downloading-assets) | Download assets referenced by the export (user avatars, attached files, embedded images, etc.). Default: false | +| | [--reuse-media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#reuse-assets) | Reuse previously downloaded assets to avoid redundant requests. Default: false | +| | [--media-dir](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#downloading-assets) | Directory to store assets from all exported channels in the same place | +| | [--locale](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#changing-the-date-format) | Format used when writing dates. Default: en-US | +| | [--include-threads](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#including-threads) | Specify whether to include threads (and which type) in the export. By default, threads are not included. It has possible values of `none`, `active`, or `all`, indicating which threads should be included. To include both active and archived threads, use `--include-threads all`. | +| | [--include-vc](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#including-voice-channels) | Include voice channels in the export. Default: true | +| | -h | Shows help text | + +> **Note**: +> Options with an asterisk (**\***) are required. The order of the options doesn't matter. + +#### Including threads + +By default, threads are not included in the export. You can change this behavior by using `--include-threads` and specifying which threads should be included. It has possible values of `none`, `active`, or `all`, indicating which threads should be included. To include both active and archived threads, use `--include-threads all`. + +```console +dotnet DiscordChatExporter.Cli.dll exportguild -t "mfa.Ifrn" -g 21814 --include-threads all +``` + +#### Including voice channels + +By default, voice channels are included in the export. You can change this behavior by using `--include-vc` and specifying whether to include voice channels in the export. It has possible values of `true` or `false`, to exclude voice channels, use `--include-vc false`. + +```console +dotnet DiscordChatExporter.Cli.dll exportguild -t "mfa.Ifrn" -g 21814 --include-vc false +``` + +### `exportall` + +This command exports **all accessible channels**, including server channels and DMs. + +| | Option | Description | +| ------ | ------------------------------------------------------------------------------------------------------------------------- | ----------- | +| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | +| | [-o](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-output-filename) | Output file or directory path | +| | [-f](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#changing-the-format) | [Output file format](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#file-formats). Default: HtmlDark | +| | [--after](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#date-ranges) | Only include messages sent after this date | +| | [--before](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#date-ranges) | Only include messages sent before this date | +| | [-p](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#partitioning) | Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb) | +| | [--filter](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Message-filters.md) | Special notation for filtering the messages that get included in the export | +| | [--media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#downloading-assets) | Download assets referenced by the export (user avatars, attached files, embedded images, etc.). Default: false | +| | [--reuse-media](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#reuse-assets) | Reuse previously downloaded assets to avoid redundant requests. Default: false | +| | [--media-dir](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#downloading-assets) | Directory to store assets from all exported channels in the same place | +| | [--locale](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#changing-the-date-format) | Format used when writing dates. Default: en-US | +| | [--include-threads](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#including-threads) | Specify whether to include threads (and which type) in the export. By default, threads are not included. It has possible values of `none`, `active`, or `all`, indicating which threads should be included. To include both active and archived threads, use `--include-threads all`. | +| | [--include-vc](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#including-voice-channels) | Include voice channels in the export. Default: true | +| | [--include-dm](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#excluding-dms) | Include direct messages in the export. Default: true | +| | -h | Shows help text | + +> **Note**: +> Options with an asterisk (**\***) are required. The order of the options doesn't matter. + +#### Excluding DMs + +To exclude DMs, add the `--include-dm false` option. + +```console +dotnet DiscordChatExporter.Cli.dll exportall -t "mfa.Ifrn" --include-dm false +``` + +### `channels` + +This command outputs a **server's channels** in the following format: +`Channel ID | Channel Name` +To save the output to a file, run the command below. If the file already exists, it will be overwritten. + +| | Option | Description | +| ------ | ---------------------------------------------------------------------------------------------------- | ----------- | +| **\*** | -g | [Server ID](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-guild-id-or-guild-channel-id) | +| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | +| | [--include-threads](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#including-threads) | Specify whether to include threads (and which type) in the output. By default, threads are not included. It has possible values of `none`, `active`, or `all`, indicating which threads should be included. To include both active and archived threads, use `--include-threads all`. | +| | [--include-vc](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Using-the-CLI.md#including-voice-channels) | Include voice channels in the output. Default: true | +| | -h | Shows help text | + +> **Note**: +> Options with an asterisk (**\***) are required. The order of the options doesn't matter. + +To save the output to a file, run the command with `> C:\path\…` like the example below. If the file already exists, it will be overwritten. + +```console +dotnet DiscordChatExporter.Cli.dll channels -t "mfa.Ifrn" -g 21814 > C:\path\to\output.txt +``` + +### `dm` + +This command outputs a list of your **direct messages**. + +| | Option | Description | +| ------ | ---------------------------------------------------------------------------------------------------- | ----------- | +| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | +| | -h | Shows help text | + +> **Note**: +> Options with an asterisk (**\***) are required. The order of the options doesn't matter. + +To save the output to a file, run the command with `> C:\path\…` like the example below. If the file already exists, it will be overwritten. + +```console +dotnet DiscordChatExporter.Cli.dll dm -t "mfa.Ifrn" > C:\path\to\output.txt +``` + +### `guilds` + +This command outputs a list of your **servers**. + +| | Option | Description | +| ------ | ---------------------------------------------------------------------------------------------------- | ----------- | +| **\*** | [-t](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Getting-started.md#basic-usage) | [Authorization token](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md#how-to-get-user-token). Environment variable: `DISCORD_TOKEN` | +| | -h | Shows help text | + +> **Note**: +> Options with an asterisk (**\***) are required. The order of the options doesn't matter. + +To save the output to a file, run the command with `> C:\path\…` like the example below. If the file already exists, it will be overwritten. + +```console +dotnet DiscordChatExporter.Cli.dll guilds -t "mfa.Ifrn" > C:\path\to\output.txt +``` + +### `guide` + +This command explains [how to get your token, guild, and channel IDs](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Token-and-IDs.md). diff --git a/.docs/Using-the-GUI.md b/.docs/Using-the-GUI.md new file mode 100644 index 0000000..382f796 --- /dev/null +++ b/.docs/Using-the-GUI.md @@ -0,0 +1,97 @@ +# Using the GUI + +## Video tutorial + +[![Video tutorial](https://i.ytimg.com/vi/jjtu0VQXV7I/hqdefault.jpg)](https://youtube.com/watch?v=jjtu0VQXV7I) + +> Video by [NoIntro Tutorials](https://youtube.com/channel/UCFezKSxdNKJe77-hYiuXu3Q). + +## Guide + +### Step 1 + +After extracting the `.zip`, open `DiscordChatExporter.exe` + +### Step 2 + +Please refer to the on-screen instructions to get your token, then paste your token in the upper text box and hit ENTER or click the arrow (→). + +> **Warning**: +> **Never share your token!** +> A token gives full access to an account, treat it like a password. + + + +### Step 3 + +DCE will display your Direct Messages and a sidebar with your server list. Select the channel you would like to export, then click the ![Screenshot](https://i.imgur.com/dnTOlDa.png) button to continue. + +> **Note**: +> You can export multiple channels at once by holding `CTRL` or `SHIFT` while selecting. +> You can also double-click a channel to export it without clicking the ![Screenshot](https://i.imgur.com/dnTOlDa.png) button. + + + +### Step 4 + +In this screen you can customize the following: + +- **Output path** - The folder where the exported chat(s) will be saved. + +- **Export format** - HTML (Dark), HTML (Light), TXT, CSV and JSON + +- **Date range (after/before)** (Optional) - If set, only messages sent in the provided date range will be exported. Only one value (either after or before) is required if you want to use this option. + > **Note**: + > Please note that the time defaults to **12:00 AM** (midnight/00:00). This means that if you choose to export between Sep 17th and Sep 18th, messages from Sep 18th won't be exported. + +- **Partition limit** (Optional) - Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb). For example, a channel with 36 messages set to be partitioned every 10 messages will output 4 files. + +- **Message Filter** (Optional) - Special notation for filtering the messages that get included in the export. See [Message filters](https://github.com/Tyrrrz/DiscordChatExporter/blob/master/.docs/Message-filters.md) for more info. + +- **Format markdown** (Optional) - Disable markdown processing when exporting. You can use this to produce JSON or plain text exports without unwrapping mentions, custom emoji, and certain other special tokens. + +- **Download assets** (Optional) - If this option is set, the export will include additional files such as user avatars, attached files, images, etc. Only files that are referenced by the export are downloaded, which means that, for example, user avatars will not be downloaded when using the plain text (TXT) export format. A folder containing the assets will be created along with the exported chat. They must be kept together. + +- **Reuse assets** (Optional) - If this option is set, the export will reuse already downloaded assets to skip redundant requests. This option is only available when **Download assets** is enabled. + +- **Assets directory path** (Optional) - If this option is set, the export will use the specified directory to store assets from all exported channels in the same place. + +> **Note**: +> You need to scroll down to see all available options. + +## Settings + +- **Auto-update** +Perform automatic updates on every launch. +Default: Enabled + + > **Note**: + > Keep this option enabled to receive the latest features and bug fixes! + +- **Dark mode** +Use darker colors in the UI (User Interface). +Default: Disabled + +- **Persist token** +Persist last used token between sessions. +Default: Enabled + +- **Show threads** +Controls whether threads are shown in the channel list. +Default: none + +- **Locale** +Customize how dates are formatted in the exported files. + +- **Date format** +Customize how dates are formatted in the exported files in the settings menu (). + +- **Parallel limit** +The number of channels that will be exported at the same time. +Default: 1 + +- **Normalize to UTC** +Convert all dates to UTC before exporting. + + > **Note**: + > Try to keep this number low so that your account doesn't get flagged.