From 6582e26cd3cd25b540d246bfce881ddad4ab26ae Mon Sep 17 00:00:00 2001 From: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Date: Wed, 24 May 2023 21:54:51 +0300 Subject: [PATCH] Increase padding in output to accomodate longer snowflakes --- .../Commands/GetChannelsCommand.cs | 16 +++++++++------- .../Commands/GetDirectChannelsCommand.cs | 2 +- .../Commands/GetGuildsCommand.cs | 5 +++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs b/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs index a4cd1bc..2088e8d 100644 --- a/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs +++ b/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs @@ -36,17 +36,19 @@ public class GetChannelsCommand : DiscordCommandBase .ThenBy(c => c.Name) .ToArray(); - var threads = IncludeThreads - ? (await Discord.GetGuildThreadsAsync(GuildId, cancellationToken)) - .OrderBy(c => c.Name) - .ToArray() - : Array.Empty(); + var threads = Array.Empty(); + if (IncludeThreads) + { + threads = (await Discord.GetGuildThreadsAsync(GuildId, cancellationToken)) + .OrderBy(c => c.Name) + .ToArray(); + } foreach (var channel in channels) { // Channel ID await console.Output.WriteAsync( - channel.Id.ToString().PadRight(18, ' ') + channel.Id.ToString().PadRight(20, ' ') ); // Separator @@ -64,7 +66,7 @@ public class GetChannelsCommand : DiscordCommandBase // Thread ID await console.Output.WriteAsync( - thread.Id.ToString().PadRight(18, ' ') + thread.Id.ToString().PadRight(20, ' ') ); // Separator diff --git a/DiscordChatExporter.Cli/Commands/GetDirectChannelsCommand.cs b/DiscordChatExporter.Cli/Commands/GetDirectChannelsCommand.cs index 5271de7..d4a999a 100644 --- a/DiscordChatExporter.Cli/Commands/GetDirectChannelsCommand.cs +++ b/DiscordChatExporter.Cli/Commands/GetDirectChannelsCommand.cs @@ -26,7 +26,7 @@ public class GetDirectChannelsCommand : DiscordCommandBase { // Channel ID await console.Output.WriteAsync( - channel.Id.ToString().PadRight(18, ' ') + channel.Id.ToString().PadRight(20, ' ') ); // Separator diff --git a/DiscordChatExporter.Cli/Commands/GetGuildsCommand.cs b/DiscordChatExporter.Cli/Commands/GetGuildsCommand.cs index e5efe3e..d3a174d 100644 --- a/DiscordChatExporter.Cli/Commands/GetGuildsCommand.cs +++ b/DiscordChatExporter.Cli/Commands/GetGuildsCommand.cs @@ -19,13 +19,14 @@ public class GetGuildsCommand : DiscordCommandBase var guilds = (await Discord.GetUserGuildsAsync(cancellationToken)) // Show direct messages first .OrderByDescending(g => g.Id == Guild.DirectMessages.Id) - .ThenBy(g => g.Name); + .ThenBy(g => g.Name) + .ToArray(); foreach (var guild in guilds) { // Guild ID await console.Output.WriteAsync( - guild.Id.ToString().PadRight(18, ' ') + guild.Id.ToString().PadRight(20, ' ') ); // Separator