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