add postback payload description in message
This commit is contained in:
parent
2c315dffcd
commit
3b5ffe2343
11
message.go
11
message.go
@ -130,12 +130,19 @@ type PostBack struct {
|
|||||||
Recipient Recipient `json:"-"`
|
Recipient Recipient `json:"-"`
|
||||||
// Time is when the message was sent.
|
// Time is when the message was sent.
|
||||||
Time time.Time `json:"-"`
|
Time time.Time `json:"-"`
|
||||||
// PostBack ID
|
// PostBack Payload
|
||||||
Payload string `json:"payload"`
|
Payload PostBackPayload `json:"payload"`
|
||||||
// Optional referral info
|
// Optional referral info
|
||||||
Referral Referral `json:"referral"`
|
Referral Referral `json:"referral"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PostBackPayload represents payload data in PostBack
|
||||||
|
type PostBackPayload struct {
|
||||||
|
Title string `json:"title"`
|
||||||
|
Payload string `json:"payload"`
|
||||||
|
Mid string `json:"mid"`
|
||||||
|
}
|
||||||
|
|
||||||
type AccountLinking struct {
|
type AccountLinking struct {
|
||||||
// Sender is who the message was sent from.
|
// Sender is who the message was sent from.
|
||||||
Sender Sender `json:"-"`
|
Sender Sender `json:"-"`
|
||||||
|
22
receiving.go
22
receiving.go
@ -117,20 +117,20 @@ type Payload struct {
|
|||||||
URL string `json:"url,omitempty"`
|
URL string `json:"url,omitempty"`
|
||||||
Title string `json:"title,omitempty"`
|
Title string `json:"title,omitempty"`
|
||||||
// Coordinates is Lat/Long pair of location pin
|
// Coordinates is Lat/Long pair of location pin
|
||||||
Coordinates *Coordinates `json:"coordinates,omitempty"`
|
Coordinates *Coordinates `json:"coordinates,omitempty"`
|
||||||
TemplateType string `json:"template_type,omitempty"`
|
TemplateType string `json:"template_type,omitempty"`
|
||||||
Buttons []Button `json:"buttons,omitempty"`
|
Buttons []Button `json:"buttons,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Button struct {
|
type Button struct {
|
||||||
Type string `json:"type,omitempty"`
|
Type string `json:"type,omitempty"`
|
||||||
Title string `json:"title,omitempty"`
|
Title string `json:"title,omitempty"`
|
||||||
Payload string `json:"payload,omitempty"`
|
Payload string `json:"payload,omitempty"`
|
||||||
URL string `json:"url,omitempty"`
|
URL string `json:"url,omitempty"`
|
||||||
WebviewHeightRatio string `json:"webview_height_ratio,omitempty"`
|
WebviewHeightRatio string `json:"webview_height_ratio,omitempty"`
|
||||||
MessengerExtensions bool `json:"messenger_extensions,omitempty"`
|
MessengerExtensions bool `json:"messenger_extensions,omitempty"`
|
||||||
FallbackURL string `json:"fallback_url,omitempty"`
|
FallbackURL string `json:"fallback_url,omitempty"`
|
||||||
WebviewShareButton string `json:"webview_share_button,omitempty"`
|
WebviewShareButton string `json:"webview_share_button,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Coordinates is a pair of latitude and longitude.
|
// Coordinates is a pair of latitude and longitude.
|
||||||
|
Loading…
Reference in New Issue
Block a user