From dc8c74bcc8a1c310e7d768a1186d750d02780b7f Mon Sep 17 00:00:00 2001 From: Audino <2676737+audinowho@users.noreply.github.com> Date: Fri, 18 Apr 2025 23:07:15 -0800 Subject: [PATCH] move thread inclusion to base class --- .../Commands/Base/ExportCommandBase.cs | 8 ++++++++ DiscordChatExporter.Cli/Commands/ExportAllCommand.cs | 7 ------- DiscordChatExporter.Cli/Commands/ExportChannelsCommand.cs | 7 ------- DiscordChatExporter.Cli/Commands/ExportGuildCommand.cs | 7 ------- 4 files changed, 8 insertions(+), 21 deletions(-) diff --git a/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs b/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs index 67f99910..5f007deb 100644 --- a/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs +++ b/DiscordChatExporter.Cli/Commands/Base/ExportCommandBase.cs @@ -8,6 +8,7 @@ using CliFx.Attributes; using CliFx.Exceptions; using CliFx.Infrastructure; using DiscordChatExporter.Cli.Commands.Converters; +using DiscordChatExporter.Cli.Commands.Shared; using DiscordChatExporter.Cli.Utils.Extensions; using DiscordChatExporter.Core.Discord; using DiscordChatExporter.Core.Discord.Data; @@ -64,6 +65,13 @@ public abstract class ExportCommandBase : DiscordCommandBase )] public PartitionLimit PartitionLimit { get; init; } = PartitionLimit.Null; + [CommandOption( + "include-threads", + Description = "Which types of threads should be included.", + Converter = typeof(ThreadInclusionModeBindingConverter) + )] + public ThreadInclusionMode ThreadInclusionMode { get; init; } = ThreadInclusionMode.None; + [CommandOption( "filter", Description = "Only include messages that satisfy this filter. " diff --git a/DiscordChatExporter.Cli/Commands/ExportAllCommand.cs b/DiscordChatExporter.Cli/Commands/ExportAllCommand.cs index 1ec5e289..45d05493 100644 --- a/DiscordChatExporter.Cli/Commands/ExportAllCommand.cs +++ b/DiscordChatExporter.Cli/Commands/ExportAllCommand.cs @@ -27,13 +27,6 @@ public class ExportAllCommand : ExportCommandBase [CommandOption("include-vc", Description = "Include voice channels.")] public bool IncludeVoiceChannels { get; init; } = true; - [CommandOption( - "include-threads", - Description = "Which types of threads should be included.", - Converter = typeof(ThreadInclusionModeBindingConverter) - )] - public ThreadInclusionMode ThreadInclusionMode { get; init; } = ThreadInclusionMode.None; - [CommandOption( "data-package", Description = "Path to the personal data package (ZIP file) requested from Discord. " diff --git a/DiscordChatExporter.Cli/Commands/ExportChannelsCommand.cs b/DiscordChatExporter.Cli/Commands/ExportChannelsCommand.cs index 95f3cd61..855b0500 100644 --- a/DiscordChatExporter.Cli/Commands/ExportChannelsCommand.cs +++ b/DiscordChatExporter.Cli/Commands/ExportChannelsCommand.cs @@ -26,13 +26,6 @@ public class ExportChannelsCommand : ExportCommandBase )] public required IReadOnlyList ChannelIds { get; init; } - [CommandOption( - "include-threads", - Description = "Which types of threads should be included.", - Converter = typeof(ThreadInclusionModeBindingConverter) - )] - public ThreadInclusionMode ThreadInclusionMode { get; init; } = ThreadInclusionMode.None; - public override async ValueTask ExecuteAsync(IConsole console) { await base.ExecuteAsync(console); diff --git a/DiscordChatExporter.Cli/Commands/ExportGuildCommand.cs b/DiscordChatExporter.Cli/Commands/ExportGuildCommand.cs index 71b66467..8167dd8a 100644 --- a/DiscordChatExporter.Cli/Commands/ExportGuildCommand.cs +++ b/DiscordChatExporter.Cli/Commands/ExportGuildCommand.cs @@ -21,13 +21,6 @@ public class ExportGuildCommand : ExportCommandBase [CommandOption("include-vc", Description = "Include voice channels.")] public bool IncludeVoiceChannels { get; init; } = true; - [CommandOption( - "include-threads", - Description = "Which types of threads should be included.", - Converter = typeof(ThreadInclusionModeBindingConverter) - )] - public ThreadInclusionMode ThreadInclusionMode { get; init; } = ThreadInclusionMode.None; - public override async ValueTask ExecuteAsync(IConsole console) { await base.ExecuteAsync(console);