Documentation
¶
Index ¶
- func FacebookSetupWebhook(w http.ResponseWriter, r *http.Request)
- func GetFacebookWebhook(stateMachine fsm.StateMachine, store fsm.Store) func(http.ResponseWriter, *http.Request)
- func SendMessage(m *MessageData)
- type Attachment
- type FacebookEmitter
- type Message
- type MessageData
- type MessageEntry
- type MessageReceivedCallback
- type MessageRecipient
- type MessagingEvent
- type Payload
- type QuickReply
- type Recipient
- type SendMessageData
- type Sender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FacebookSetupWebhook ¶
func FacebookSetupWebhook(w http.ResponseWriter, r *http.Request)
FacebookSetupWebhook adds support for the Messenger Platform's webhook verification to your webhook. This is required to ensure your webhook is authentic and working.
This must be a GET request, and have the same URL as the POST request.
https://developers.facebook.com/docs/messenger-platform/getting-started/webhook-setup
func GetFacebookWebhook ¶
func GetFacebookWebhook(stateMachine fsm.StateMachine, store fsm.Store) func(http.ResponseWriter, *http.Request)
GetFacebookWebhook is the webhook that facebook posts to when a message is received from a user.
This must be a POST request, and have the same URL as the GET request.
https://developers.facebook.com/docs/messenger-platform/getting-started/webhook-setup
func SendMessage ¶
func SendMessage(m *MessageData)
Types ¶
type Attachment ¶
type FacebookEmitter ¶
type FacebookEmitter struct {
UUID string
}
func (*FacebookEmitter) Emit ¶
func (f *FacebookEmitter) Emit(input interface{}) error
type MessageData ¶
type MessageData struct {
Recipient MessageRecipient `json:"recipient"`
SenderAction string `json:"sender_action,omitempty"`
Message *SendMessageData `json:"message"`
}
type MessageEntry ¶
type MessageEntry struct {
ID string `json:"id"`
Time int64 `json:"time"`
MessagingEvents []MessagingEvent `json:"messaging"`
}
type MessageReceivedCallback ¶
type MessageReceivedCallback struct {
Object string `json:"object"`
Entry []MessageEntry `json:"entry"`
}
type MessageRecipient ¶
type MessageRecipient struct {
ID string `json:"id"`
}
type MessagingEvent ¶
type QuickReply ¶
type SendMessageData ¶
type SendMessageData struct {
Text string `json:"text,omitempty"`
Attachment *Attachment `json:"attachment,omitempty"`
QuickReplies []QuickReply `json:"quick_replies,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.
