From a9882ddddbc8f77e7a9144ad44c92d5dea4640ee Mon Sep 17 00:00:00 2001 From: Pranas Kiziela Date: Tue, 13 Nov 2018 15:41:30 +0200 Subject: [PATCH] Add default_action property to attachments --- response.go | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/response.go b/response.go index ecd6f0f..4411761 100644 --- a/response.go +++ b/response.go @@ -366,11 +366,22 @@ type StructuredMessagePayload struct { // StructuredMessageElement is a response containing structural elements type StructuredMessageElement struct { - Title string `json:"title"` - ImageURL string `json:"image_url"` - ItemURL string `json:"item_url"` - Subtitle string `json:"subtitle"` - Buttons []StructuredMessageButton `json:"buttons"` + Title string `json:"title"` + ImageURL string `json:"image_url"` + ItemURL string `json:"item_url"` + Subtitle string `json:"subtitle"` + DefaultAction *DefaultAction `json:"default_action,omitempty"` + Buttons []StructuredMessageButton `json:"buttons"` +} + +// DefaultAction is a response containing default action properties +type DefaultAction struct { + Type string `json:"type"` + URL string `json:"url,omitempty"` + WebviewHeightRatio string `json:"webview_height_ratio,omitempty"` + MessengerExtensions bool `json:"messenger_extensions,omitempty"` + FallbackURL string `json:"fallback_url,omitempty"` + WebviewShareButton string `json:"webview_share_button,omitempty"` } // StructuredMessageButton is a response containing buttons