Move Trim() from ReadLinesAsync to call site in ExportChannelsCommand

Agent-Logs-Url: https://github.com/Tyrrrz/DiscordChatExporter/sessions/6c8dcb73-6a93-428b-93e5-7bbfcfd2e252

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-04-04 08:52:02 +00:00 committed by GitHub
parent cbf74ba6a8
commit 245b368396
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View file

@ -35,7 +35,7 @@ public partial class ExportChannelsCommand : ExportCommandBase
if (channelIds.Count == 0 && console.IsInputRedirected)
{
await foreach (var line in console.Input.ReadLinesAsync(cancellationToken))
channelIds.Add(Snowflake.Parse(line));
channelIds.Add(Snowflake.Parse(line.Trim()));
}
if (channelIds.Count == 0)

View file

@ -73,8 +73,7 @@ internal static class ConsoleExtensions
{
while (await reader.ReadLineAsync(cancellationToken) is { } line)
{
line = line.Trim();
if (!string.IsNullOrEmpty(line))
if (!string.IsNullOrWhiteSpace(line))
yield return line;
}
}