Documentation ¶
Index ¶
Constants ¶
const ( // EventMessage represents the message event. EventMessage = "message" // EventDelivery represents the message-delivery event. EventDelivery = "delivery" // EventPostback represents the postback event. EventPostback = "postback" )
const Version = "0.0.2"
Version is the version of the library.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(bot Bot) http.HandlerFunc
Handler returns the handler to use for incoming messages from the Facebook Messenger Platform.
Types ¶
type Attachment ¶
Attachment represents the attachment object included in the message.
type Bot ¶
Bot is the object that receives and sends messages to the Messenger Platform.
func (Bot) Deliver ¶
func (bot Bot) Deliver(params DeliverParams) error
Deliver uses the Send API to deliver messages.
type Config ¶
Config represents the required configuration to receive and send message to the Messenger Platform.
type DeliverParams ¶
DeliverParams represents the message params sent by deliver.
type Delivery ¶
type Delivery struct { Mids []string `json:"mids"` Watermark int64 `json:"watermark"` Seq int `json:"seq"` }
Delivery represents the message-delivered callback object.
type Event ¶
type Event struct { Sender *User `json:"sender"` Recipient *User `json:"recipient"` Timestamp int64 `json:"timestamp,omitempty"` Message *Message `json:"message"` Delivery *Delivery `json:"delivery"` Postback *Postback `json:"postback"` }
Event represents the event fired by the webhook.
type Message ¶
type Message struct { Mid string `json:"mid,omitempty"` Seq int `json:"seq,omitempty"` Text string `json:"text,omitempty"` Attachment *Attachment `json:"attachment,omitempty"` Attachments []*Attachment `json:"attachments,omitempty"` }
Message represents the message callback object.
type Payload ¶
type Payload struct {
URL string `json:"url,omitempty"`
}
Payload represents the attachment payload data.