mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-12 22:25:38 -04:00
Remove unnecessary whitespaces at the end of reactions in PlainText (#1213)
This commit is contained in:
parent
72f02cd9a0
commit
6d1e8c2e02
1 changed files with 7 additions and 3 deletions
|
@ -5,6 +5,7 @@ using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using DiscordChatExporter.Core.Discord.Data;
|
using DiscordChatExporter.Core.Discord.Data;
|
||||||
using DiscordChatExporter.Core.Discord.Data.Embeds;
|
using DiscordChatExporter.Core.Discord.Data.Embeds;
|
||||||
|
using DiscordChatExporter.Core.Utils.Extensions;
|
||||||
|
|
||||||
namespace DiscordChatExporter.Core.Exporting;
|
namespace DiscordChatExporter.Core.Exporting;
|
||||||
|
|
||||||
|
@ -172,18 +173,21 @@ internal class PlainTextMessageWriter(Stream stream, ExportContext context)
|
||||||
|
|
||||||
await _writer.WriteLineAsync("{Reactions}");
|
await _writer.WriteLineAsync("{Reactions}");
|
||||||
|
|
||||||
foreach (var reaction in reactions)
|
foreach (var (reaction, i) in reactions.WithIndex())
|
||||||
{
|
{
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
await _writer.WriteAsync(' ');
|
||||||
|
}
|
||||||
|
|
||||||
await _writer.WriteAsync(reaction.Emoji.Name);
|
await _writer.WriteAsync(reaction.Emoji.Name);
|
||||||
|
|
||||||
if (reaction.Count > 1)
|
if (reaction.Count > 1)
|
||||||
{
|
{
|
||||||
await _writer.WriteAsync($" ({reaction.Count})");
|
await _writer.WriteAsync($" ({reaction.Count})");
|
||||||
}
|
}
|
||||||
|
|
||||||
await _writer.WriteAsync(' ');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await _writer.WriteLineAsync();
|
await _writer.WriteLineAsync();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue