Messenger template message.

This commit is contained in:
hchen 2023-08-20 20:23:33 -05:00
parent b68c311acb
commit 7d8226cad7
6 changed files with 46 additions and 1 deletions

View file

@ -0,0 +1,5 @@
namespace BotSharp.Plugin.MetaMessenger.Interfaces;
public interface IResponseMessage
{
}

View file

@ -0,0 +1,11 @@
using System.Text.Json.Serialization;
namespace BotSharp.Plugin.MetaMessenger.MessagingModels;
public class AttachementPayload
{
[JsonPropertyName("template_type")]
public string TemplateType { get; set; }
public string Text { get; set; }
public ButtonItem[] Buttons { get; set; }
}

View file

@ -0,0 +1,7 @@
namespace BotSharp.Plugin.MetaMessenger.MessagingModels;
public class AttachmentBody
{
public string Type { get; set; } = "template";
public AttachementPayload Payload { get; set; }
}

View file

@ -0,0 +1,8 @@
namespace BotSharp.Plugin.MetaMessenger.MessagingModels;
public class ButtonItem
{
public string Type { get; set; }
public string Title { get; set; }
public string Url { get; set; }
}

View file

@ -1,3 +1,4 @@
using BotSharp.Plugin.MetaMessenger.Interfaces;
using System.Text.Json.Serialization;
namespace BotSharp.Plugin.MetaMessenger.MessagingModels;
@ -6,7 +7,7 @@ namespace BotSharp.Plugin.MetaMessenger.MessagingModels;
/// Quick Replies
/// https://developers.facebook.com/docs/messenger-platform/send-messages/quick-replies
/// </summary>
public class QuickReplyMessage
public class QuickReplyMessage : IResponseMessage
{
[JsonPropertyName("text")]
public string Text { get; set; }

View file

@ -0,0 +1,13 @@
using BotSharp.Plugin.MetaMessenger.Interfaces;
using System.Text.Json.Serialization;
namespace BotSharp.Plugin.MetaMessenger.MessagingModels;
/// <summary>
/// https://developers.facebook.com/docs/messenger-platform/send-messages/templates
/// </summary>
public class TemplateMessage : IResponseMessage
{
[JsonPropertyName("attachment")]
public AttachmentBody Attachment { get; set; }
}