diff --git a/DiscordChatExporter.Core/Exporting/PlainTextMessageWriter.cs b/DiscordChatExporter.Core/Exporting/PlainTextMessageWriter.cs index 38206ac5c..85b46a649 100644 --- a/DiscordChatExporter.Core/Exporting/PlainTextMessageWriter.cs +++ b/DiscordChatExporter.Core/Exporting/PlainTextMessageWriter.cs @@ -5,6 +5,7 @@ using System.Threading.Tasks; using DiscordChatExporter.Core.Discord.Data; using DiscordChatExporter.Core.Discord.Data.Embeds; +using DiscordChatExporter.Core.Utils.Extensions; namespace DiscordChatExporter.Core.Exporting; @@ -172,18 +173,21 @@ private async ValueTask WriteReactionsAsync( await _writer.WriteLineAsync("{Reactions}"); - foreach (var reaction in reactions) + foreach (var (reaction, i) in reactions.WithIndex()) { cancellationToken.ThrowIfCancellationRequested(); + if (i > 0) + { + await _writer.WriteAsync(' '); + } + await _writer.WriteAsync(reaction.Emoji.Name); if (reaction.Count > 1) { await _writer.WriteAsync($" ({reaction.Count})"); } - - await _writer.WriteAsync(' '); } await _writer.WriteLineAsync();