You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DiscordChatExporter/.docs/Getting-started.md

39 KiB

Getting started

Welcome to the getting started page! Here you'll learn how to use every DiscordChatExporter (DCE for short) feature. For other things you can do with DCE, check out the Guides section.

If you still have unanswered questions after reading this page or if you have encountered a problem, please visit our FAQ & Troubleshooting section.

The information presented on this page is valid for all platforms.

GUI or CLI?

DCE has two different versions:

  • Graphical User Interface (GUI) - it's the preferred version for newcomers as it is easy to use. You can get it by downloading the DiscordChatExporter.zip file.
  • Command-line Interface (CLI) - offers greater flexibility and more features for advanced users, such as export scheduling, ID lists, and more specific date ranges. You can get it by downloading the DiscordChatExporter.CLI.zip file.

If you're not comfortable with Windows' Command-line (cmd), please choose the GUI. macOS, Linux and Docker users can only use the CLI version.

(Skip to Using the CLI or File Formats)

Using the GUI

Video tutorial

Video tutorial

Video by NoIntro Tutorials.

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.

  1. DCE will display your Direct Messages and a sidebar with your server list. Select the channel you would like to export, then click the 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 button.

  1. 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 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.
  1. 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.

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)

Using the CLI

Note: Make sure you have .NET Core installed before attempting to run the commands below. Docker users, please refer to the Docker usage instructions.

  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. macOS users can select the .exe, hit Command+I (⌘I), and copy what's after Where: to get the directory You can also drag and drop the folder on every platform.

  1. 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:

dotnet DiscordChatExporter.Cli.dll

Docker users, please refer to the Docker usage instructions.

DCE.CLI commands

Command Description
export Exports a channel
exportdm Exports all direct message channels
exportguild Exports all channels within the specified server
exportall Exports all accessible channels
channels Outputs the list of channels in the given server
dm Outputs the list of direct message channels
guilds Outputs the list of accessible servers
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, or run dotnet DiscordChatExporter.Cli.dll guide. To get help with a specific command, please run:

dotnet DiscordChatExporter.Cli.dll command -h

export

Option Description
* -c Channel ID(s)
* -t Authorization token. Environment variable: DISCORD_TOKEN
-o Output file or directory path
-f Output file format. Default: HtmlDark
--after Only include messages sent after this date
--before Only include messages sent before this date
-p Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb)
--filter Special notation for filtering the messages that get included in the export
--media Download assets referenced by the export (user avatars, attached files, embedded images, etc.). Default: false
--reuse-media Reuse previously downloaded assets to avoid redundant requests. Default: false.
--dateformat 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.

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.

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:

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 (").

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 (").

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.

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.

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.

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.

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.

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.

dotnet DiscordChatExporter.Cli.dll export -t "mfa.Ifrn" -c 53555 --dateformat "yyyy-MM-dd HH:mm"

Special thanks to @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:

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:

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:

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.

exportdm

Option Description
* -t Authorization 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 Output file or directory path
-f Output file format. Default: HtmlDark
--after Only include messages sent after this date
--before Only include messages sent before this date
-p Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb)
--filter Special notation for filtering the messages that get included in the export
--media Download assets referenced by the export (user avatars, attached files, embedded images, etc.). Default: false
--reuse-media Reuse previously downloaded assets to avoid redundant requests. Default: false.
--dateformat 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
* -t Authorization 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 Output file or directory path
-f Output file format. Default: HtmlDark
--after Only include messages sent after this date
--before Only include messages sent before this date
-p Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb)
--filter Special notation for filtering the messages that get included in the export
--media Download assets referenced by the export (user avatars, attached files, embedded images, etc.). Default: false
--reuse-media Reuse previously downloaded assets to avoid redundant requests. Default: false.
--dateformat 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 Authorization 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 Output file or directory path
-f Output file format. Default: HtmlDark
--after Only include messages sent after this date
--before Only include messages sent before this date
-p Split output into partitions, each limited to this number of messages (e.g. 100) or file size (e.g. 10mb)
--filter Special notation for filtering the messages that get included in the export
--media Download assets referenced by the export (user avatars, attached files, embedded images, etc.). Default: false
--reuse-media Reuse previously downloaded assets to avoid redundant requests. Default: false.
--dateformat 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:

dotnet DiscordChatExporter.Cli.dll exportall -t "mfa.Ifrn" --include-dm false

channels

Option Description
* -g Server ID
* -t Authorization 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.

dotnet DiscordChatExporter.Cli.dll channels -t "mfa.Ifrn" -g 21814 > C:\path\to\output.txt

dm

Option Description
* -t Authorization 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.

dotnet DiscordChatExporter.Cli.dll dm -t "mfa.Ifrn" > C:\path\to\output.txt

guilds

Option Description
* -t Authorization 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.

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.

File formats

HTML

The HTML format replicates Discord's interface, making it the most user-friendly option. It's the best format for attachment preview and sharing. You can open .html files with a web browser, such as Google Chrome.

Warning: If a picture is deleted, or if a user changes its avatar, the respective images will no longer be displayed. Export using the "Download referenced assets" (--media) option to avoid this.

Plain Text

The Plain Text format is the best option for archiving due to its small size. You can open .txt files with a text editor, such as Notepad.

JSON

The JSON format contains more technical information and is easily parsable. You can open .json files with a text editor, such as Notepad.

CSV

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)


Further reading: .NET date formats Special thanks to @Yudi