mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-04 11:33:08 -06:00
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:
parent
cbf74ba6a8
commit
245b368396
|
|
@ -35,7 +35,7 @@ public partial class ExportChannelsCommand : ExportCommandBase
|
||||||
if (channelIds.Count == 0 && console.IsInputRedirected)
|
if (channelIds.Count == 0 && console.IsInputRedirected)
|
||||||
{
|
{
|
||||||
await foreach (var line in console.Input.ReadLinesAsync(cancellationToken))
|
await foreach (var line in console.Input.ReadLinesAsync(cancellationToken))
|
||||||
channelIds.Add(Snowflake.Parse(line));
|
channelIds.Add(Snowflake.Parse(line.Trim()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (channelIds.Count == 0)
|
if (channelIds.Count == 0)
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,7 @@ internal static class ConsoleExtensions
|
||||||
{
|
{
|
||||||
while (await reader.ReadLineAsync(cancellationToken) is { } line)
|
while (await reader.ReadLineAsync(cancellationToken) is { } line)
|
||||||
{
|
{
|
||||||
line = line.Trim();
|
if (!string.IsNullOrWhiteSpace(line))
|
||||||
if (!string.IsNullOrEmpty(line))
|
|
||||||
yield return line;
|
yield return line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue