diff --git a/DiscordChatExporter.Cli.Tests/Specs/HtmlWriting/AttachmentSpecs.cs b/DiscordChatExporter.Cli.Tests/Specs/HtmlWriting/AttachmentSpecs.cs
index c998e773..253ae769 100644
--- a/DiscordChatExporter.Cli.Tests/Specs/HtmlWriting/AttachmentSpecs.cs
+++ b/DiscordChatExporter.Cli.Tests/Specs/HtmlWriting/AttachmentSpecs.cs
@@ -42,7 +42,7 @@ public record AttachmentSpecs(ExportWrapperFixture ExportWrapper) : IClassFixtur
Snowflake.Parse("885654862656843786")
);
- var imageUrl = message.QuerySelector("img[alt*=\"attachment\" i]")?.GetAttribute("src");
+ var imageUrl = message.QuerySelector(".chatlog__attachment img")?.GetAttribute("src");
// Assert
message.Text().Should().Contain("Image attachment");
diff --git a/DiscordChatExporter.Core/Discord/Data/Attachment.cs b/DiscordChatExporter.Core/Discord/Data/Attachment.cs
index 67766700..4020cc14 100644
--- a/DiscordChatExporter.Core/Discord/Data/Attachment.cs
+++ b/DiscordChatExporter.Core/Discord/Data/Attachment.cs
@@ -13,6 +13,7 @@ public partial record Attachment(
Snowflake Id,
string Url,
string FileName,
+ string? Description,
int? Width,
int? Height,
FileSize FileSize) : IHasId
@@ -37,8 +38,9 @@ public partial record Attachment
var width = json.GetPropertyOrNull("width")?.GetInt32OrNull();
var height = json.GetPropertyOrNull("height")?.GetInt32OrNull();
var fileName = json.GetProperty("filename").GetNonNullString();
+ var description = json.GetPropertyOrNull("description")?.GetNonWhiteSpaceStringOrNull();
var fileSize = json.GetProperty("size").GetInt64().Pipe(FileSize.FromBytes);
- return new Attachment(id, url, fileName, width, height, fileSize);
+ return new Attachment(id, url, fileName, description, width, height, fileSize);
}
}
\ No newline at end of file
diff --git a/DiscordChatExporter.Core/Exporting/Writers/Html/MessageGroupTemplate.cshtml b/DiscordChatExporter.Core/Exporting/Writers/Html/MessageGroupTemplate.cshtml
index 068ef974..ddd96470 100644
--- a/DiscordChatExporter.Core/Exporting/Writers/Html/MessageGroupTemplate.cshtml
+++ b/DiscordChatExporter.Core/Exporting/Writers/Html/MessageGroupTemplate.cshtml
@@ -158,19 +158,19 @@
@if (attachment.IsImage)
{
-
+
}
else if (attachment.IsVideo)
{
}
else if (attachment.IsAudio)
{
}
else