From d1d560fb55bc7c13a5722790cc409c67b5716fd1 Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Mon, 21 Aug 2023 17:24:05 +0300 Subject: [PATCH] Add `--include-vc` to the `channels` command --- DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs b/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs index b3712045..3565e245 100644 --- a/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs +++ b/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs @@ -20,6 +20,12 @@ public class GetChannelsCommand : DiscordCommandBase )] public required Snowflake GuildId { get; init; } + [CommandOption( + "include-vc", + Description = "Include voice channels." + )] + public bool IncludeVoiceChannels { get; init; } = true; + [CommandOption( "include-threads", Description = "Include threads in the output." @@ -38,6 +44,7 @@ public class GetChannelsCommand : DiscordCommandBase var channels = (await Discord.GetGuildChannelsAsync(GuildId, cancellationToken)) .Where(c => c.Kind != ChannelKind.GuildCategory) + .Where(c => IncludeVoiceChannels || !c.Kind.IsVoice()) .OrderBy(c => c.Parent?.Position) .ThenBy(c => c.Name) .ToArray();