Skip to content
This repository was archived by the owner on Jan 1, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions response.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type AttachmentType string
type MessagingType string
type TopElementStyle string
type ImageAspectRatio string
type SenderAction string

const (
// SendMessageURL is API endpoint for sending messages.
Expand Down Expand Up @@ -57,6 +58,10 @@ const (
HorizontalImageAspectRatio ImageAspectRatio = "horizontal"
// ImageAspectRatio is square.
SquareImageAspectRatio ImageAspectRatio = "square"

SenderActionMarkSeen SenderAction = "mark_seen"
SenderActionTypingOn SenderAction = "typing_on"
SenderActionTypingOff SenderAction = "typing_off"
)

// QueryResponse is the response sent back by Facebook when setting up things
Expand Down Expand Up @@ -326,7 +331,7 @@ func (r *Response) ListTemplate(elements *[]StructuredMessageElement, messagingT
}

// SenderAction sends a info about sender action
func (r *Response) SenderAction(action string) error {
func (r *Response) SenderAction(action SenderAction) error {
m := SendSenderAction{
Recipient: r.to,
SenderAction: action,
Expand Down Expand Up @@ -478,6 +483,6 @@ type StructuredMessageButton struct {

// SendSenderAction is the information about sender action
type SendSenderAction struct {
Recipient Recipient `json:"recipient"`
SenderAction string `json:"sender_action"`
Recipient Recipient `json:"recipient"`
SenderAction SenderAction `json:"sender_action"`
}