mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-31 06:48:23 -04:00
Add --include-vc
to the channels
command
This commit is contained in:
parent
6fba60e570
commit
d1d560fb55
1 changed files with 7 additions and 0 deletions
|
@ -20,6 +20,12 @@ public class GetChannelsCommand : DiscordCommandBase
|
||||||
)]
|
)]
|
||||||
public required Snowflake GuildId { get; init; }
|
public required Snowflake GuildId { get; init; }
|
||||||
|
|
||||||
|
[CommandOption(
|
||||||
|
"include-vc",
|
||||||
|
Description = "Include voice channels."
|
||||||
|
)]
|
||||||
|
public bool IncludeVoiceChannels { get; init; } = true;
|
||||||
|
|
||||||
[CommandOption(
|
[CommandOption(
|
||||||
"include-threads",
|
"include-threads",
|
||||||
Description = "Include threads in the output."
|
Description = "Include threads in the output."
|
||||||
|
@ -38,6 +44,7 @@ public class GetChannelsCommand : DiscordCommandBase
|
||||||
|
|
||||||
var channels = (await Discord.GetGuildChannelsAsync(GuildId, cancellationToken))
|
var channels = (await Discord.GetGuildChannelsAsync(GuildId, cancellationToken))
|
||||||
.Where(c => c.Kind != ChannelKind.GuildCategory)
|
.Where(c => c.Kind != ChannelKind.GuildCategory)
|
||||||
|
.Where(c => IncludeVoiceChannels || !c.Kind.IsVoice())
|
||||||
.OrderBy(c => c.Parent?.Position)
|
.OrderBy(c => c.Parent?.Position)
|
||||||
.ThenBy(c => c.Name)
|
.ThenBy(c => c.Name)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue