Template [Translate]

This commit is contained in:
Haiping Chen 2024-05-07 21:14:01 -05:00
parent 2a5d0ac4ef
commit 0703488660
4 changed files with 6 additions and 3 deletions

View file

@ -39,6 +39,8 @@ public class GenericElement
{
[Translate]
public string Title { get; set; }
[Translate]
public string Subtitle { get; set; }
[JsonPropertyName("image_url")]

View file

@ -1,4 +1,3 @@
using BotSharp.Abstraction.Messaging.Enums;
using Newtonsoft.Json;
namespace BotSharp.Abstraction.Messaging.Models.RichContent.Template;
@ -11,6 +10,7 @@ public class MultiSelectTemplateMessage : IRichMessage, ITemplateMessage
[JsonPropertyName("text")]
[JsonProperty("text")]
[Translate]
public string Text { get; set; } = string.Empty;
[JsonPropertyName("template_type")]
@ -28,6 +28,7 @@ public class MultiSelectTemplateMessage : IRichMessage, ITemplateMessage
public class OptionElement
{
[Translate]
public string Title { get; set; } = string.Empty;
public string Type { get; set; } = string.Empty;
public string? Payload { get; set; }

View file

@ -1,4 +1,3 @@
using BotSharp.Abstraction.Messaging.Enums;
using Newtonsoft.Json;
namespace BotSharp.Abstraction.Messaging.Models.RichContent.Template;
@ -11,6 +10,7 @@ public class ProductTemplateMessage : IRichMessage, ITemplateMessage
[JsonPropertyName("text")]
[JsonProperty("text")]
[Translate]
public string Text { get; set; } = string.Empty;
[JsonPropertyName("template_type")]

View file

@ -1,4 +1,3 @@
using BotSharp.Abstraction.Messaging.Enums;
using Newtonsoft.Json;
namespace BotSharp.Abstraction.Messaging.Models.RichContent;
@ -9,6 +8,7 @@ public class TextMessage : IRichMessage
[JsonProperty("rich_type")]
public string RichType => RichTypeEnum.Text;
[Translate]
public string Text { get; set; } = string.Empty;
public TextMessage(string text)