Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public static class BotSharpMessageParser
{
targetType = typeof(ProgramCodeTemplateMessage);
}
else if (richType == RichTypeEnum.EmbeddingTemplate)
{
targetType = typeof(EmbeddingTemplateMessage);
}
else if (richType == RichTypeEnum.GenericTemplate)
{
if (root.TryGetProperty("element_type", out element))
Expand Down Expand Up @@ -92,6 +96,10 @@ public static class BotSharpMessageParser
{
targetType = typeof(ProgramCodeTemplateMessage);
}
else if (templateType == TemplateTypeEnum.Embedding)
{
targetType = typeof(EmbeddingTemplateMessage);
}
else if (templateType == TemplateTypeEnum.Generic)
{
if (root.TryGetProperty("element_type", out element))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public static class RichTypeEnum
public const string MultiSelectTemplate = "multi-select_template";
public const string CouponTemplate = "coupon_template";
public const string GenericTemplate = "generic_template";
public const string EmbeddingTemplate = "embedding_template";
public const string QuickReply = "quick_reply";
public const string Text = "text";
public const string Attachment = "attachment";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ public static class TemplateTypeEnum
public const string Generic = "generic";
public const string MultiSelect = "multi-select";
public const string ProgramCode = "program_code";
public const string Embedding = "embedding";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace BotSharp.Abstraction.Messaging.Models.RichContent.Template;

public class EmbeddingTemplateMessage : IRichMessage, ITemplateMessage
{
[JsonPropertyName("rich_type")]
public string RichType => RichTypeEnum.EmbeddingTemplate;

[JsonPropertyName("title")]
public string Title { get; set; } = string.Empty;

[JsonPropertyName("text")]
public string Text { get; set; } = string.Empty;

[JsonPropertyName("html_tag")]
public string HtmlTag { get; set; } = "iframe";

[JsonPropertyName("template_type")]
public virtual string TemplateType { get; set; } = TemplateTypeEnum.Embedding;

[JsonPropertyName("url")]
public string Url { get; set; } = string.Empty;
}
Loading