mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-14 07:43:31 -07:00
30 lines
931 B
C#
30 lines
931 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using DiscordChatExporter.Cli.Verbs.Options;
|
|
using DiscordChatExporter.Core.Services;
|
|
|
|
namespace DiscordChatExporter.Cli.Verbs
|
|
{
|
|
public class GetDirectMessageChannelsVerb : Verb<GetDirectMessageChannelsOptions>
|
|
{
|
|
public GetDirectMessageChannelsVerb(GetDirectMessageChannelsOptions options)
|
|
: base(options)
|
|
{
|
|
}
|
|
|
|
public override async Task ExecuteAsync()
|
|
{
|
|
// Get data service
|
|
var container = new Container();
|
|
var dataService = container.Resolve<IDataService>();
|
|
|
|
// Get channels
|
|
var channels = await dataService.GetDirectMessageChannelsAsync(Options.GetToken());
|
|
|
|
// Print result
|
|
foreach (var channel in channels.OrderBy(c => c.Name))
|
|
Console.WriteLine($"{channel.Id} | {channel.Name}");
|
|
}
|
|
}
|
|
} |