Skip to content

Commit

Permalink
Remove unnecessary prefixes from CLI docs (#1254)
Browse files Browse the repository at this point in the history
Co-authored-by: Oleksii Holub <[email protected]>
  • Loading branch information
LostXOR and Tyrrrz authored Jun 29, 2024
1 parent 4298011 commit 767ca1b
Showing 1 changed file with 32 additions and 29 deletions.
61 changes: 32 additions & 29 deletions .docs/Using-the-CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Step 1

After extracting the `.zip`, open Command Prompt, aka `cmd` (`Terminal` on **macOS** and **Linux**).
After extracting the `.zip` archive, open your preferred terminal.

## Step 2

Expand All @@ -18,15 +18,18 @@ You can also drag and drop the folder on **every platform**.

## 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.
Now we're ready to run the commands.

Type the following command in your terminal of choice, then press ENTER to run it. This will list all available subcommands and options.

```console
$ ./DiscordChatExporter.Cli
./DiscordChatExporter.Cli
```

> **Note**:
> On Windows, if you're using the default Command Prompt (`cmd`), omit the leading `./` at the start of the command.

> **Docker** users, please refer to the [Docker usage instructions](Docker.md).
## CLI commands
Expand All @@ -47,21 +50,21 @@ To use the commands, you'll need a token. For the instructions on how to get a t
To get help with a specific command, run:

```console
$ ./DiscordChatExporter.Cli command --help
./DiscordChatExporter.Cli command --help
```

For example, to figure out how to use the `export` command, run:

```console
$ ./DiscordChatExporter.Cli export --help
./DiscordChatExporter.Cli export --help
```

## Export a specific channel

You can quickly export with DCE's default settings by using just `-t token` and `-c channelid`.

```console
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555
./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555
```

#### Changing the format
Expand All @@ -70,15 +73,15 @@ You can change the export format to `HtmlDark`, `HtmlLight`, `PlainText` `Json`
format is `HtmlDark`.

```console
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 -f Json
./DiscordChatExporter.Cli 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
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 -o myserver.html
./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 -o myserver.html
```

#### Changing the output directory
Expand All @@ -88,7 +91,7 @@ extension.
If any of the folders in the path have a space in its name, escape them with quotes (").

```console
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 -o "C:\Discord Exports"
./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 -o "C:\Discord Exports"
```

#### Changing the filename and output directory
Expand All @@ -98,15 +101,15 @@ Note that the filename must have an extension, otherwise it will be considered a
If any of the folders in the path have a space in its name, escape them with quotes (").

```console
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 -o "C:\Discord Exports\myserver.html"
./DiscordChatExporter.Cli 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 server and channel metadata.

```console
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 -o "C:\Discord Exports\%G\%T\%C.html"
./DiscordChatExporter.Cli 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
Expand All @@ -133,13 +136,13 @@ You can use partitioning to split files after a given number of messages or file
For example, a channel with 36 messages set to be partitioned every 10 messages will output 4 files.

```console
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 -p 10
./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 -p 10
```

A 45 MB channel set to be partitioned every 20 MB will output 3 files.

```console
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 -p 20mb
./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 -p 20mb
```

#### Downloading assets
Expand All @@ -150,7 +153,7 @@ 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
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --media
./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --media
```

#### Reusing assets
Expand All @@ -159,7 +162,7 @@ Previously downloaded assets can be reused to skip redundant downloads as long a
same folder. Using this option can speed up future exports. This option requires the `--media` option.

```console
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --media --reuse-media
./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --media --reuse-media
```

#### Changing the media directory
Expand All @@ -168,7 +171,7 @@ By default, the media directory is created alongside the exported chat. You can
providing a path that ends with a slash. All of the exported media will be stored in this directory.

```console
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --media --media-dir "C:\Discord Media"
./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --media --media-dir "C:\Discord Media"
```

#### Changing the date format
Expand All @@ -177,7 +180,7 @@ You can customize how dates are formatted in the exported files by using `--loca
locales. The default locale is `en-US`.

```console
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --locale "de-DE"
./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --locale "de-DE"
```

#### Date ranges
Expand All @@ -186,22 +189,22 @@ $ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --locale "de-DE"
Use `--before` to export messages sent before the provided date. E.g. messages sent before September 18th, 2019:

```console
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --before 2019-09-18
./DiscordChatExporter.Cli 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
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --after "2019-09-17 23:34"
./DiscordChatExporter.Cli 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
$ ./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --after "2019-09-17 23:34" --before "2019-09-18"
./DiscordChatExporter.Cli 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
Expand All @@ -215,7 +218,7 @@ formats [here](https://docs.microsoft.com/en-us/dotnet/standard/base-types/custo
To export all channels in a specific server, use the `exportguild` command and provide the server ID through the `-g|--guild` option:

```console
$ ./DiscordChatExporter.Cli exportguild -t "mfa.Ifrn" -g 21814
./DiscordChatExporter.Cli exportguild -t "mfa.Ifrn" -g 21814
```

#### Including threads
Expand All @@ -225,7 +228,7 @@ specifying which threads should be included. It has possible values of `none`, `
threads should be included. To include both active and archived threads, use `--include-threads all`.

```console
$ ./DiscordChatExporter.Cli exportguild -t "mfa.Ifrn" -g 21814 --include-threads all
./DiscordChatExporter.Cli exportguild -t "mfa.Ifrn" -g 21814 --include-threads all
```

#### Including voice channels
Expand All @@ -235,45 +238,45 @@ specifying whether to include voice channels in the export. It has possible valu
voice channels, use `--include-vc false`.

```console
$ ./DiscordChatExporter.Cli exportguild -t "mfa.Ifrn" -g 21814 --include-vc false
./DiscordChatExporter.Cli exportguild -t "mfa.Ifrn" -g 21814 --include-vc false
```

### Export all channels

To export all accessible channels, use the `exportall` command:

```console
$ ./DiscordChatExporter.Cli exportall -t "mfa.Ifrn"
./DiscordChatExporter.Cli exportall -t "mfa.Ifrn"
```

#### Excluding DMs

To exclude DMs, add the `--include-dm false` option.

```console
$ ./DiscordChatExporter.Cli exportall -t "mfa.Ifrn" --include-dm false
./DiscordChatExporter.Cli exportall -t "mfa.Ifrn" --include-dm false
```

### List channels in a server

To list the channels available in a specific server, use the `channels` command and provide the server ID through the `-g|--guild` option:

```console
$ ./DiscordChatExporter.Cli channels -t "mfa.Ifrn" -g 21814
./DiscordChatExporter.Cli channels -t "mfa.Ifrn" -g 21814
```

### List direct message channels

To list all DM channels accessible to the current account, use the `dm` command:

```console
$ ./DiscordChatExporter.Cli dm -t "mfa.Ifrn"
./DiscordChatExporter.Cli dm -t "mfa.Ifrn"
```

### List servers

To list all servers accessible by the current account, use the `guilds` command:

```console
$ ./DiscordChatExporter.Cli guilds -t "mfa.Ifrn" > C:\path\to\output.txt
./DiscordChatExporter.Cli guilds -t "mfa.Ifrn" > C:\path\to\output.txt
```

0 comments on commit 767ca1b

Please sign in to comment.