mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-06-03 08:08:40 -04:00
parent
7b72f473fd
commit
94ef4b6981
12 changed files with 39 additions and 51 deletions
|
@ -31,13 +31,7 @@ public class ExportAllCommand : ExportCommandBase
|
|||
continue;
|
||||
|
||||
await foreach (var channel in Discord.GetGuildChannelsAsync(guild.Id, cancellationToken))
|
||||
{
|
||||
// Skip non-text channels
|
||||
if (!channel.Kind.IsText())
|
||||
continue;
|
||||
|
||||
channels.Add(channel);
|
||||
}
|
||||
}
|
||||
|
||||
await base.ExecuteAsync(console, channels);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using CliFx.Attributes;
|
||||
using CliFx.Infrastructure;
|
||||
using DiscordChatExporter.Cli.Commands.Base;
|
||||
|
@ -19,8 +18,7 @@ public class ExportDirectMessagesCommand : ExportCommandBase
|
|||
|
||||
await console.Output.WriteLineAsync("Fetching channels...");
|
||||
var channels = await Discord.GetGuildChannelsAsync(Guild.DirectMessages.Id, cancellationToken);
|
||||
var textChannels = channels.Where(c => c.Kind.IsText()).ToArray();
|
||||
|
||||
await base.ExecuteAsync(console, textChannels);
|
||||
await base.ExecuteAsync(console, channels);
|
||||
}
|
||||
}
|
|
@ -1,10 +1,8 @@
|
|||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
using CliFx.Attributes;
|
||||
using CliFx.Infrastructure;
|
||||
using DiscordChatExporter.Cli.Commands.Base;
|
||||
using DiscordChatExporter.Core.Discord;
|
||||
using DiscordChatExporter.Core.Discord.Data;
|
||||
using DiscordChatExporter.Core.Utils.Extensions;
|
||||
|
||||
namespace DiscordChatExporter.Cli.Commands;
|
||||
|
@ -28,8 +26,7 @@ public class ExportGuildCommand : ExportCommandBase
|
|||
|
||||
await console.Output.WriteLineAsync("Fetching channels...");
|
||||
var channels = await Discord.GetGuildChannelsAsync(GuildId, cancellationToken);
|
||||
var textChannels = channels.Where(c => c.Kind.IsText()).ToArray();
|
||||
|
||||
await base.ExecuteAsync(console, textChannels);
|
||||
await base.ExecuteAsync(console, channels);
|
||||
}
|
||||
}
|
|
@ -5,7 +5,6 @@ using CliFx.Attributes;
|
|||
using CliFx.Infrastructure;
|
||||
using DiscordChatExporter.Cli.Commands.Base;
|
||||
using DiscordChatExporter.Core.Discord;
|
||||
using DiscordChatExporter.Core.Discord.Data;
|
||||
using DiscordChatExporter.Core.Utils.Extensions;
|
||||
|
||||
namespace DiscordChatExporter.Cli.Commands;
|
||||
|
@ -26,7 +25,6 @@ public class GetChannelsCommand : TokenCommandBase
|
|||
var cancellationToken = console.RegisterCancellationHandler();
|
||||
|
||||
var channels = (await Discord.GetGuildChannelsAsync(GuildId, cancellationToken))
|
||||
.Where(c => c.Kind.IsText())
|
||||
.OrderBy(c => c.Category.Position)
|
||||
.ThenBy(c => c.Name)
|
||||
.ToArray();
|
||||
|
|
|
@ -17,7 +17,6 @@ public class GetDirectMessageChannelsCommand : TokenCommandBase
|
|||
var cancellationToken = console.RegisterCancellationHandler();
|
||||
|
||||
var channels = (await Discord.GetGuildChannelsAsync(Guild.DirectMessages.Id, cancellationToken))
|
||||
.Where(c => c.Kind.IsText())
|
||||
.OrderByDescending(c => c.LastMessageId)
|
||||
.ThenBy(c => c.Name)
|
||||
.ToArray();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue