diff --git a/DiscordChatExporter/Services/ExportService.cs b/DiscordChatExporter/Services/ExportService.cs index 71d7cdf..876634b 100644 --- a/DiscordChatExporter/Services/ExportService.cs +++ b/DiscordChatExporter/Services/ExportService.cs @@ -224,7 +224,7 @@ namespace DiscordChatExporter.Services // User mentions (<@id>) foreach (var mentionedUser in message.MentionedUsers) - content = content.Replace($"<@{mentionedUser.Id}>", $"@{mentionedUser}"); + content = Regex.Replace(content, $"<@!?{mentionedUser.Id}>", $"@{mentionedUser}"); // Role mentions (<@&id>) foreach (var mentionedRole in message.MentionedRoles) @@ -279,7 +279,7 @@ namespace DiscordChatExporter.Services // User mentions (<@id>) foreach (var mentionedUser in message.MentionedUsers) { - content = content.Replace($"<@{mentionedUser.Id}>", + content = Regex.Replace(content, $"<@!?{mentionedUser.Id}>", $"" + $"@{HtmlEncode(mentionedUser.Name)}" + "");