Add `--include-vc` to the `channels` command

pull/1125/head
Tyrrrz 1 year ago
parent 6fba60e570
commit d1d560fb55

@ -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();

Loading…
Cancel
Save