mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-02 08:09:16 +00:00
21 lines
665 B
C#
21 lines
665 B
C#
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using CliFx;
|
|
using CliFx.Attributes;
|
|
using DiscordChatExporter.Cli.Commands.Base;
|
|
using DiscordChatExporter.Domain.Utilities;
|
|
|
|
namespace DiscordChatExporter.Cli.Commands
|
|
{
|
|
[Command("guilds", Description = "Get the list of accessible guilds.")]
|
|
public class GetGuildsCommand : TokenCommandBase
|
|
{
|
|
public override async ValueTask ExecuteAsync(IConsole console)
|
|
{
|
|
var guilds = await GetDiscordClient().GetUserGuildsAsync();
|
|
|
|
foreach (var guild in guilds.OrderBy(g => g.Name))
|
|
console.Output.WriteLine($"{guild.Id} | {guild.Name}");
|
|
}
|
|
}
|
|
} |