This commit is contained in:
Oleksii Holub
2018-12-19 17:15:54 +02:00
parent bf5cedb646
commit e22e1c03fb
5 changed files with 27 additions and 12 deletions

View File

@@ -34,9 +34,11 @@ namespace DiscordChatExporter.Cli.Verbs
// Get channels
var channels = await dataService.GetGuildChannelsAsync(Options.GetToken(), Options.GuildId);
// Filter and order channels
channels = channels.Where(c => c.Type == ChannelType.GuildTextChat).OrderBy(c => c.Name).ToArray();
// Loop through channels
foreach (var channel in channels.Where(c => c.Type.IsEither(ChannelType.GuildTextChat))
.OrderBy(c => c.Name))
foreach (var channel in channels)
{
try
{

View File

@@ -4,7 +4,6 @@ using System.Threading.Tasks;
using DiscordChatExporter.Cli.Verbs.Options;
using DiscordChatExporter.Core.Models;
using DiscordChatExporter.Core.Services;
using Tyrrrz.Extensions;
namespace DiscordChatExporter.Cli.Verbs
{
@@ -23,9 +22,11 @@ namespace DiscordChatExporter.Cli.Verbs
// Get channels
var channels = await dataService.GetGuildChannelsAsync(Options.GetToken(), Options.GuildId);
// Filter and order channels
channels = channels.Where(c => c.Type == ChannelType.GuildTextChat).OrderBy(c => c.Name).ToArray();
// Print result
foreach (var channel in channels.Where(c => c.Type.IsEither(ChannelType.GuildTextChat))
.OrderBy(c => c.Name))
foreach (var channel in channels)
Console.WriteLine($"{channel.Id} | {channel.Name}");
}
}

View File

@@ -21,8 +21,11 @@ namespace DiscordChatExporter.Cli.Verbs
// Get channels
var channels = await dataService.GetDirectMessageChannelsAsync(Options.GetToken());
// Order channels
channels = channels.OrderBy(c => c.Name).ToArray();
// Print result
foreach (var channel in channels.OrderBy(c => c.Name))
foreach (var channel in channels)
Console.WriteLine($"{channel.Id} | {channel.Name}");
}
}

View File

@@ -21,8 +21,11 @@ namespace DiscordChatExporter.Cli.Verbs
// Get guilds
var guilds = await dataService.GetUserGuildsAsync(Options.GetToken());
// Order guilds
guilds = guilds.OrderBy(g => g.Name).ToArray();
// Print result
foreach (var guild in guilds.OrderBy(g => g.Name))
foreach (var guild in guilds)
Console.WriteLine($"{guild.Id} | {guild.Name}");
}
}