mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-08-15 08:39:36 +02:00
Fix export JSON detection to use numeric check; rename GuildIds to ServerIds in GetChannelsCommand
Agent-Logs-Url: https://github.com/Tyrrrz/DiscordChatExporter/sessions/ab01ba49-ad07-42ba-b382-27f4d105a92b Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1835af12d5
commit
f6e710909c
@@ -18,7 +18,7 @@ namespace DiscordChatExporter.Cli.Commands;
|
||||
public partial class GetChannelsCommand : DiscordCommandBase
|
||||
{
|
||||
[CommandParameter(0, Name = "server-ids", Description = "Server ID(s).")]
|
||||
public required IReadOnlyList<Snowflake> GuildIds { get; set; }
|
||||
public required IReadOnlyList<Snowflake> ServerIds { get; set; }
|
||||
|
||||
[CommandOption("include-vc", Description = "Include voice channels.")]
|
||||
public bool IncludeVoiceChannels { get; set; } = true;
|
||||
@@ -38,9 +38,9 @@ public partial class GetChannelsCommand : DiscordCommandBase
|
||||
|
||||
var allChannels = new List<Channel>();
|
||||
|
||||
foreach (var guildId in GuildIds)
|
||||
foreach (var serverId in ServerIds)
|
||||
{
|
||||
var channels = (await Discord.GetGuildChannelsAsync(guildId, cancellationToken))
|
||||
var channels = (await Discord.GetGuildChannelsAsync(serverId, cancellationToken))
|
||||
.Where(c => !c.IsCategory)
|
||||
.Where(c => IncludeVoiceChannels || !c.IsVoice)
|
||||
.OrderBy(c => c.Parent?.Position)
|
||||
@@ -51,7 +51,7 @@ public partial class GetChannelsCommand : DiscordCommandBase
|
||||
ThreadInclusionMode != ThreadInclusionMode.None
|
||||
? (
|
||||
await Discord.GetGuildThreadsAsync(
|
||||
guildId,
|
||||
serverId,
|
||||
ThreadInclusionMode == ThreadInclusionMode.All,
|
||||
null,
|
||||
null,
|
||||
|
||||
Reference in New Issue
Block a user