mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-03-30 10:25:28 +00:00
@@ -31,6 +31,10 @@ namespace DiscordChatExporter.Cli.Commands
|
||||
|
||||
await foreach (var channel in Discord.GetGuildChannelsAsync(guild.Id))
|
||||
{
|
||||
// Skip non-text channels
|
||||
if (!channel.IsTextChannel)
|
||||
continue;
|
||||
|
||||
channels.Add(channel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CliFx.Attributes;
|
||||
using CliFx.Infrastructure;
|
||||
using DiscordChatExporter.Cli.Commands.Base;
|
||||
@@ -17,9 +18,10 @@ namespace DiscordChatExporter.Cli.Commands
|
||||
// Get channel metadata
|
||||
await console.Output.WriteLineAsync("Fetching channels...");
|
||||
var channels = await Discord.GetGuildChannelsAsync(Guild.DirectMessages.Id);
|
||||
var textChannels = channels.Where(c => c.IsTextChannel).ToArray();
|
||||
|
||||
// Export
|
||||
await ExportAsync(console, channels);
|
||||
await ExportAsync(console, textChannels);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using CliFx.Attributes;
|
||||
using CliFx.Infrastructure;
|
||||
using DiscordChatExporter.Cli.Commands.Base;
|
||||
@@ -20,9 +21,10 @@ namespace DiscordChatExporter.Cli.Commands
|
||||
// Get channel metadata
|
||||
await console.Output.WriteLineAsync("Fetching channels...");
|
||||
var channels = await Discord.GetGuildChannelsAsync(GuildId);
|
||||
var textChannels = channels.Where(c => c.IsTextChannel).ToArray();
|
||||
|
||||
// Export
|
||||
await ExportAsync(console, channels);
|
||||
await ExportAsync(console, textChannels);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,13 @@ namespace DiscordChatExporter.Cli.Commands
|
||||
{
|
||||
var channels = await Discord.GetGuildChannelsAsync(GuildId);
|
||||
|
||||
foreach (var channel in channels.OrderBy(c => c.Category.Position).ThenBy(c => c.Name))
|
||||
var textChannels = channels
|
||||
.Where(c => c.IsTextChannel)
|
||||
.OrderBy(c => c.Category.Position)
|
||||
.ThenBy(c => c.Name)
|
||||
.ToArray();
|
||||
|
||||
foreach (var channel in textChannels)
|
||||
{
|
||||
// Channel ID
|
||||
await console.Output.WriteAsync(channel.Id.ToString());
|
||||
|
||||
@@ -16,7 +16,13 @@ namespace DiscordChatExporter.Cli.Commands
|
||||
{
|
||||
var channels = await Discord.GetGuildChannelsAsync(Guild.DirectMessages.Id);
|
||||
|
||||
foreach (var channel in channels.OrderBy(c => c.Name))
|
||||
var textChannels = channels
|
||||
.Where(c => c.IsTextChannel)
|
||||
.OrderBy(c => c.Category.Position)
|
||||
.ThenBy(c => c.Name)
|
||||
.ToArray();
|
||||
|
||||
foreach (var channel in textChannels)
|
||||
{
|
||||
// Channel ID
|
||||
await console.Output.WriteAsync(channel.Id.ToString());
|
||||
|
||||
Reference in New Issue
Block a user