diff --git a/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs b/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs index 28e069e..cfcef1a 100644 --- a/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs +++ b/DiscordChatExporter.Cli/Commands/GetChannelsCommand.cs @@ -25,18 +25,18 @@ public class GetChannelsCommand : TokenCommandBase { var cancellationToken = console.RegisterCancellationHandler(); - var channels = await Discord.GetGuildChannelsAsync(GuildId, cancellationToken); - - var textChannels = channels + var channels = (await Discord.GetGuildChannelsAsync(GuildId, cancellationToken)) .Where(c => c.Kind.IsText()) .OrderBy(c => c.Category.Position) .ThenBy(c => c.Name) .ToArray(); - foreach (var channel in textChannels) + foreach (var channel in channels) { // Channel ID - await console.Output.WriteAsync(channel.Id.ToString()); + await console.Output.WriteAsync( + channel.Id.ToString().PadRight(18, ' ') + ); // Separator using (console.WithForegroundColor(ConsoleColor.DarkGray)) diff --git a/DiscordChatExporter.Cli/Commands/GetDirectMessageChannelsCommand.cs b/DiscordChatExporter.Cli/Commands/GetDirectMessageChannelsCommand.cs index cda9afd..adaa647 100644 --- a/DiscordChatExporter.Cli/Commands/GetDirectMessageChannelsCommand.cs +++ b/DiscordChatExporter.Cli/Commands/GetDirectMessageChannelsCommand.cs @@ -16,18 +16,18 @@ public class GetDirectMessageChannelsCommand : TokenCommandBase { var cancellationToken = console.RegisterCancellationHandler(); - var channels = await Discord.GetGuildChannelsAsync(Guild.DirectMessages.Id, cancellationToken); - - var textChannels = channels + var channels = (await Discord.GetGuildChannelsAsync(Guild.DirectMessages.Id, cancellationToken)) .Where(c => c.Kind.IsText()) .OrderByDescending(c => c.LastMessageId) .ThenBy(c => c.Name) .ToArray(); - foreach (var channel in textChannels) + foreach (var channel in channels) { // Channel ID - await console.Output.WriteAsync(channel.Id.ToString()); + await console.Output.WriteAsync( + channel.Id.ToString().PadRight(18, ' ') + ); // Separator using (console.WithForegroundColor(ConsoleColor.DarkGray)) diff --git a/DiscordChatExporter.Cli/Commands/GetGuildsCommand.cs b/DiscordChatExporter.Cli/Commands/GetGuildsCommand.cs index 92fa041..a0024b7 100644 --- a/DiscordChatExporter.Cli/Commands/GetGuildsCommand.cs +++ b/DiscordChatExporter.Cli/Commands/GetGuildsCommand.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using CliFx.Attributes; using CliFx.Infrastructure; using DiscordChatExporter.Cli.Commands.Base; +using DiscordChatExporter.Core.Discord.Data; using DiscordChatExporter.Core.Utils.Extensions; namespace DiscordChatExporter.Cli.Commands; @@ -15,12 +16,17 @@ public class GetGuildsCommand : TokenCommandBase { var cancellationToken = console.RegisterCancellationHandler(); - var guilds = await Discord.GetUserGuildsAsync(cancellationToken); + var guilds = (await Discord.GetUserGuildsAsync(cancellationToken)) + // Show direct messages first + .OrderByDescending(g => g.Id == Guild.DirectMessages.Id) + .ThenBy(g => g.Name); - foreach (var guild in guilds.OrderBy(g => g.Name)) + foreach (var guild in guilds) { // Guild ID - await console.Output.WriteAsync(guild.Id.ToString()); + await console.Output.WriteAsync( + guild.Id.ToString().PadRight(18, ' ') + ); // Separator using (console.WithForegroundColor(ConsoleColor.DarkGray))