|
|
@ -29,15 +29,11 @@ public class ExportAllCommand : ExportCommandBase
|
|
|
|
|
|
|
|
|
|
|
|
[CommandOption(
|
|
|
|
[CommandOption(
|
|
|
|
"include-threads",
|
|
|
|
"include-threads",
|
|
|
|
Description = "Specifies which types of threads should be included.",
|
|
|
|
Description = "Which types of threads should be included.",
|
|
|
|
Converter = typeof(ThreadInclusionBindingConverter)
|
|
|
|
Converter = typeof(ThreadInclusionBindingConverter)
|
|
|
|
)]
|
|
|
|
)]
|
|
|
|
public ThreadInclusion ThreadInclusion { get; init; } = ThreadInclusion.None;
|
|
|
|
public ThreadInclusion ThreadInclusion { get; init; } = ThreadInclusion.None;
|
|
|
|
|
|
|
|
|
|
|
|
private bool IncludeThreads => ThreadInclusion != ThreadInclusion.None;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool IncludeArchivedThreads => ThreadInclusion.HasFlag(ThreadInclusion.Archived);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[CommandOption(
|
|
|
|
[CommandOption(
|
|
|
|
"data-package",
|
|
|
|
"data-package",
|
|
|
|
Description = "Path to the personal data package (ZIP file) requested from Discord. "
|
|
|
|
Description = "Path to the personal data package (ZIP file) requested from Discord. "
|
|
|
@ -74,12 +70,12 @@ public class ExportAllCommand : ExportCommandBase
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Threads
|
|
|
|
// Threads
|
|
|
|
if (IncludeThreads)
|
|
|
|
if (ThreadInclusion != ThreadInclusion.None)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await foreach (
|
|
|
|
await foreach (
|
|
|
|
var thread in Discord.GetGuildThreadsAsync(
|
|
|
|
var thread in Discord.GetGuildThreadsAsync(
|
|
|
|
guild.Id,
|
|
|
|
guild.Id,
|
|
|
|
IncludeArchivedThreads,
|
|
|
|
ThreadInclusion == ThreadInclusion.All,
|
|
|
|
cancellationToken
|
|
|
|
cancellationToken
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -136,9 +132,9 @@ public class ExportAllCommand : ExportCommandBase
|
|
|
|
channels.RemoveAll(c => c.Kind.IsGuild());
|
|
|
|
channels.RemoveAll(c => c.Kind.IsGuild());
|
|
|
|
if (!IncludeVoiceChannels)
|
|
|
|
if (!IncludeVoiceChannels)
|
|
|
|
channels.RemoveAll(c => c.Kind.IsVoice());
|
|
|
|
channels.RemoveAll(c => c.Kind.IsVoice());
|
|
|
|
if (!IncludeThreads)
|
|
|
|
if (ThreadInclusion == ThreadInclusion.None)
|
|
|
|
channels.RemoveAll(c => c.Kind.IsThread());
|
|
|
|
channels.RemoveAll(c => c.Kind.IsThread());
|
|
|
|
if (!IncludeArchivedThreads)
|
|
|
|
if (ThreadInclusion != ThreadInclusion.All)
|
|
|
|
channels.RemoveAll(c => c.Kind.IsThread() && c.IsArchived);
|
|
|
|
channels.RemoveAll(c => c.Kind.IsThread() && c.IsArchived);
|
|
|
|
|
|
|
|
|
|
|
|
await ExportAsync(console, channels);
|
|
|
|
await ExportAsync(console, channels);
|
|
|
|