File tree Expand file tree Collapse file tree
src/Infrastructure/BotSharp.Abstraction/Messaging
Models/RichContent/Template Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,6 +42,10 @@ public static class BotSharpMessageParser
4242 {
4343 targetType = typeof ( ProgramCodeTemplateMessage ) ;
4444 }
45+ else if ( richType == RichTypeEnum . EmbeddingTemplate )
46+ {
47+ targetType = typeof ( EmbeddingTemplateMessage ) ;
48+ }
4549 else if ( richType == RichTypeEnum . GenericTemplate )
4650 {
4751 if ( root . TryGetProperty ( "element_type" , out element ) )
@@ -92,6 +96,10 @@ public static class BotSharpMessageParser
9296 {
9397 targetType = typeof ( ProgramCodeTemplateMessage ) ;
9498 }
99+ else if ( templateType == TemplateTypeEnum . Embedding )
100+ {
101+ targetType = typeof ( EmbeddingTemplateMessage ) ;
102+ }
95103 else if ( templateType == TemplateTypeEnum . Generic )
96104 {
97105 if ( root . TryGetProperty ( "element_type" , out element ) )
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ public static class RichTypeEnum
66 public const string MultiSelectTemplate = "multi-select_template" ;
77 public const string CouponTemplate = "coupon_template" ;
88 public const string GenericTemplate = "generic_template" ;
9+ public const string EmbeddingTemplate = "embedding_template" ;
910 public const string QuickReply = "quick_reply" ;
1011 public const string Text = "text" ;
1112 public const string Attachment = "attachment" ;
Original file line number Diff line number Diff line change @@ -7,4 +7,5 @@ public static class TemplateTypeEnum
77 public const string Generic = "generic" ;
88 public const string MultiSelect = "multi-select" ;
99 public const string ProgramCode = "program_code" ;
10+ public const string Embedding = "embedding" ;
1011}
Original file line number Diff line number Diff line change 1+ namespace BotSharp . Abstraction . Messaging . Models . RichContent . Template ;
2+
3+ public class EmbeddingTemplateMessage : IRichMessage , ITemplateMessage
4+ {
5+ [ JsonPropertyName ( "rich_type" ) ]
6+ public string RichType => RichTypeEnum . EmbeddingTemplate ;
7+
8+ [ JsonPropertyName ( "title" ) ]
9+ public string Title { get ; set ; } = string . Empty ;
10+
11+ [ JsonPropertyName ( "text" ) ]
12+ public string Text { get ; set ; } = string . Empty ;
13+
14+ [ JsonPropertyName ( "html_tag" ) ]
15+ public string HtmlTag { get ; set ; } = "iframe" ;
16+
17+ [ JsonPropertyName ( "template_type" ) ]
18+ public virtual string TemplateType { get ; set ; } = TemplateTypeEnum . Embedding ;
19+
20+ [ JsonPropertyName ( "url" ) ]
21+ public string Url { get ; set ; } = string . Empty ;
22+ }
You can’t perform that action at this time.
0 commit comments