diff --git a/src/WhatsApp/Content.cs b/src/WhatsApp/Content.cs index 5c2abb1..9e315e6 100644 --- a/src/WhatsApp/Content.cs +++ b/src/WhatsApp/Content.cs @@ -116,6 +116,11 @@ public record AudioContent(string Id, string Mime, string Sha256) : MediaContent /// Hash of the image. public record ImageContent(string Id, string Mime, string Sha256) : MediaContent(Id, Mime, Sha256) { + /// + /// Optional caption for the image. + /// + public string? Caption { get; init; } + /// [JsonIgnore] public override ContentType Type => ContentType.Image; @@ -129,6 +134,11 @@ public record ImageContent(string Id, string Mime, string Sha256) : MediaContent /// Hash of the video. public record VideoContent(string Id, string Mime, string Sha256) : MediaContent(Id, Mime, Sha256) { + /// + /// Optional caption for the image. + /// + public string? Caption { get; init; } + /// [JsonIgnore] public override ContentType Type => ContentType.Video; diff --git a/src/WhatsApp/Message.cs b/src/WhatsApp/Message.cs index b657b6a..da661fd 100644 --- a/src/WhatsApp/Message.cs +++ b/src/WhatsApp/Message.cs @@ -136,6 +136,7 @@ .value.messages[0] as $msg | { "$type": $msgType, "id": $msg[$msgType].id, + "caption": $msg[$msgType].caption, "mime": $msg[$msgType].mime_type, "sha256": $msg[$msgType].sha256 }