mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-14 07:43:31 -07:00
Updated Readme and user guides
The Readme file, the troubleshooting file and the CLI & GUI guides have been updated according to the recent changes, and now contain information on the new export options. The new error that may occur to prevent accidentally overwriting an existing export file has also been added to the troubleshooting file. Additionally, the exporter has been improved and now also removes the existing export's asset files if they're at their default location.
This commit is contained in:
parent
da3bcefbb9
commit
96cf48e65a
|
|
@ -60,7 +60,9 @@ No, DCE is an exporter.
|
||||||
|
|
||||||
### Can DCE add new messages to an existing export?
|
### Can DCE add new messages to an existing export?
|
||||||
|
|
||||||
No.
|
Yes, existing exports can be appended.
|
||||||
|
In this case, the existing export file won't be changed, but a new partition file will be created, which will contain
|
||||||
|
all newer messages.
|
||||||
|
|
||||||
## First steps
|
## First steps
|
||||||
|
|
||||||
|
|
@ -82,7 +84,10 @@ Check the following pages to learn how to schedule **DiscordChatExporter.CLI** r
|
||||||
|
|
||||||
### 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`.
|
Re-export the channel using a partition size; this will cause the exporter to split up the export into multiple smaller
|
||||||
|
files you can open.
|
||||||
|
|
||||||
|
Alternatively, you could also try to open it with a different program or use a different file format, like `PlainText`.
|
||||||
|
|
||||||
### I see messages in the export, but they have no content
|
### I see messages in the export, but they have no content
|
||||||
|
|
||||||
|
|
@ -146,6 +151,18 @@ Red Hat: `cert-sync --user /etc/pki/tls/certs/ca-bundle.crt`
|
||||||
|
|
||||||
If it still doesn't work, try mozroots: `mozroots --import --ask-remove`
|
If it still doesn't work, try mozroots: `mozroots --import --ask-remove`
|
||||||
|
|
||||||
|
```yml
|
||||||
|
System.InvalidOperationException: Error: The target export file already exists. This should never happen.
|
||||||
|
```
|
||||||
|
|
||||||
|
↳ This means that a file with the export target path somehow exists despite not having been detected.
|
||||||
|
It's a failsafe implemented to prevent unintentionally overwriting a file.
|
||||||
|
|
||||||
|
It might occur if you try to export the same channel multiple times in parallel, or if you've manually deleted some
|
||||||
|
partition files.
|
||||||
|
|
||||||
|
In that case, double-check the command, manually delete the respective export files and try again.
|
||||||
|
|
||||||
## macOS-specific
|
## macOS-specific
|
||||||
|
|
||||||
### DiscordChatExporter is damaged and can’t be opened. You should move it to the Trash.
|
### DiscordChatExporter is damaged and can’t be opened. You should move it to the Trash.
|
||||||
|
|
|
||||||
|
|
@ -175,6 +175,32 @@ providing a path that ends with a slash. All of the exported media will be store
|
||||||
./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"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Handling existing exports
|
||||||
|
|
||||||
|
By default, the exporter aborts the current channel export if it had previously been exported to prevent accidental
|
||||||
|
overwrites.
|
||||||
|
But it also has the options to either overwrite or append the existing export.
|
||||||
|
You can specify the desired behaviour by using `--export-exists` with one of the possible values `abort`, `append`
|
||||||
|
and `overwrite`.
|
||||||
|
|
||||||
|
```console
|
||||||
|
./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --export-exists append
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Search for existing exports
|
||||||
|
|
||||||
|
By default, the exporter only tests whether there is an existing export at the target file path.
|
||||||
|
But the exporter can also search in the entire target directory to determine whether one of the current channels had
|
||||||
|
previously been exported.
|
||||||
|
This is necessary to detect an existing export if the name of the channel, the channel parent or the guild has changed
|
||||||
|
or if the default file formatting has changed.
|
||||||
|
The `--search-existing-exports` option enables this.
|
||||||
|
|
||||||
|
```console
|
||||||
|
./DiscordChatExporter.Cli export -t "mfa.Ifrn" -c 53555 --search-existing-exports
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
#### Changing the date format
|
#### Changing the date format
|
||||||
|
|
||||||
You can customize how dates are formatted in the exported files by using `--locale` and inserting one of Discord's
|
You can customize how dates are formatted in the exported files by using `--locale` and inserting one of Discord's
|
||||||
|
|
|
||||||
|
|
@ -103,3 +103,12 @@ Default: 1
|
||||||
|
|
||||||
- **Normalize to UTC** - Convert all dates to UTC before exporting.
|
- **Normalize to UTC** - Convert all dates to UTC before exporting.
|
||||||
|
|
||||||
|
- **Export exists** Controls what the exporter should do if the current channel had previously been exported.
|
||||||
|
Default: Abort
|
||||||
|
|
||||||
|
- **Search for existing export** Whether the exporter should search in the entire target directory to determine whether
|
||||||
|
one of the current channels had previously been exported.
|
||||||
|
This is necessary to detect an existing export if the name of the channel, the channel parent or the guild has changed
|
||||||
|
or if the default file formatting has changed.
|
||||||
|
Default: Disabled
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ public class ConsoleProgressLogger(IAnsiConsole console) : ProgressLogger
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prints a summary on all previously logged exports and their respective results to the console.
|
/// Prints a summary on all previously logged exports and their respective results to the console.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="updateType">The file exists handling of the export whose summary should be printed.</param>
|
/// <param name="updateType">The export exists handling of the export whose summary should be printed.</param>
|
||||||
public void PrintExportSummary(ExportExistsHandling updateType)
|
public void PrintExportSummary(ExportExistsHandling updateType)
|
||||||
{
|
{
|
||||||
var exportSummary = GetExportSummary(updateType);
|
var exportSummary = GetExportSummary(updateType);
|
||||||
|
|
|
||||||
|
|
@ -228,7 +228,7 @@ public class ChannelExporter(DiscordClient discord)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles the existing export files of the current request according to the set file exists handling.
|
/// Handles the existing export files of the current request according to the set export exists handling.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="request">The request specifying the current channel export.</param>
|
/// <param name="request">The request specifying the current channel export.</param>
|
||||||
/// <param name="logger">The logger that's used to log progress updates about the export.</param>
|
/// <param name="logger">The logger that's used to log progress updates about the export.</param>
|
||||||
|
|
@ -268,6 +268,12 @@ public class ChannelExporter(DiscordClient discord)
|
||||||
case ExportExistsHandling.Overwrite:
|
case ExportExistsHandling.Overwrite:
|
||||||
logger.LogWarning(request, "Removing existing export files");
|
logger.LogWarning(request, "Removing existing export files");
|
||||||
MessageExporter.RemoveExistingExport(existingExportFile);
|
MessageExporter.RemoveExistingExport(existingExportFile);
|
||||||
|
var possibleExistingExportDir = $"{existingExportFile}_Files{Path.DirectorySeparatorChar}";
|
||||||
|
if (Directory.Exists(possibleExistingExportDir))
|
||||||
|
{
|
||||||
|
logger.LogWarning(request, "Removing existing export asset files");
|
||||||
|
Directory.Delete(possibleExistingExportDir, true);
|
||||||
|
}
|
||||||
currentPartitionIndex = 0;
|
currentPartitionIndex = 0;
|
||||||
return true;
|
return true;
|
||||||
case ExportExistsHandling.Append:
|
case ExportExistsHandling.Append:
|
||||||
|
|
@ -275,6 +281,7 @@ public class ChannelExporter(DiscordClient discord)
|
||||||
{
|
{
|
||||||
logger.LogInfo(request, "Moving existing export files to the new file names");
|
logger.LogInfo(request, "Moving existing export files to the new file names");
|
||||||
MessageExporter.MoveExistingExport(existingExportFile, request.OutputFilePath);
|
MessageExporter.MoveExistingExport(existingExportFile, request.OutputFilePath);
|
||||||
|
// The asset directory isn't renamed as the file contents still point to the old name
|
||||||
}
|
}
|
||||||
|
|
||||||
var lastMessageSnowflake = MessageExporter.GetLastMessageSnowflake(
|
var lastMessageSnowflake = MessageExporter.GetLastMessageSnowflake(
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ public abstract class ProgressLogger
|
||||||
/// Generates and returns a summary on all previously logged exports and their respective results.
|
/// Generates and returns a summary on all previously logged exports and their respective results.
|
||||||
/// The summary is returned as one string for each export result that occurred at least once.
|
/// The summary is returned as one string for each export result that occurred at least once.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="updateType">The file exists handling of the export whose summary should be returned.</param>
|
/// <param name="updateType">The export exists handling of the export whose summary should be returned.</param>
|
||||||
/// <returns>A summary on all previously logged exports and their respective results.</returns>
|
/// <returns>A summary on all previously logged exports and their respective results.</returns>
|
||||||
protected Dictionary<ExportResult, string> GetExportSummary(ExportExistsHandling updateType)
|
protected Dictionary<ExportResult, string> GetExportSummary(ExportExistsHandling updateType)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ public class SnackbarProgressLogger(SnackbarManager snackbarManager) : ProgressL
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Prints a summary on all previously logged exports and their respective results in the GUI snackbar.
|
/// Prints a summary on all previously logged exports and their respective results in the GUI snackbar.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="updateType">The file exists handling of the export whose summary should be printed.</param>
|
/// <param name="updateType">The export exists handling of the export whose summary should be printed.</param>
|
||||||
public void PrintExportSummary(ExportExistsHandling updateType)
|
public void PrintExportSummary(ExportExistsHandling updateType)
|
||||||
{
|
{
|
||||||
var exportSummary = GetExportSummary(updateType);
|
var exportSummary = GetExportSummary(updateType);
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ To learn more about the war and how you can help, [click here](https://tyrrrz.me
|
||||||
- Multiple output formats: HTML (dark/light), TXT, CSV, JSON
|
- Multiple output formats: HTML (dark/light), TXT, CSV, JSON
|
||||||
- Support for markdown, attachments, embeds, emoji, and other rich media features
|
- Support for markdown, attachments, embeds, emoji, and other rich media features
|
||||||
- File partitioning, date ranges, message filtering, and other export options
|
- File partitioning, date ranges, message filtering, and other export options
|
||||||
|
- Automatic detection and appending of existing exports
|
||||||
- Self-contained exports that can be viewed offline
|
- Self-contained exports that can be viewed offline
|
||||||
|
|
||||||
## Screenshots
|
## Screenshots
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue