fblib

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const MessageTypeMessageTag = 3

MessageTypeMessageTag is non-promotional and is being sent outside the 24-hour standard messaging window with a message tag.

View Source
const MessageTypeResponse = 1

MessageTypeResponse is in response to a received message.

View Source
const MessageTypeUpdate = 2

MessageTypeUpdate is being sent proactively and is not in response to a received message.

Variables

View Source
var ErrInvalidCallToFacebook = errors.New("")

ErrInvalidCallToFacebook is specific error when Facebook Messenger returns error after being called

Functions

func GenerateButtonElements

func GenerateButtonElements(title string, subtitle string, imgURL string, options []string) (elements []*fbmodelsend.TemplateElement)

GenerateButtonElements generates Messenger buttons

func GenerateQuickReplyOptions

func GenerateQuickReplyOptions(opcoes []string) (qrf []*fbmodelsend.QuickReply, err error)

GenerateQuickReplyOptions generates quick replies based on string slices with defitions. Format: title#payload

func GetUserData

func GetUserData(senderID string, accessToken string) (*fbmodelsend.User, error)

GetUserData - Get Facebook User's data. It can be obtained after she starts a conversation with Bot

func SendAskUserLocation

func SendAskUserLocation(text string, recipient string, accessToken string, msgType int) (err error)

SendAskUserLocation sends small message asking the users their location

func SendAudioMessage

func SendAudioMessage(url string, recipient string, accessToken string, msgType int) (err error)

SendAudioMessage - Sends audio message to a recipient on Facebook Messenger

func SendButtonMessage

func SendButtonMessage(template []*fbmodelsend.Button, text string, recipient string, accessToken string, msgType int) (err error)

SendButtonMessage - Sends a generic rich message to Facebook user. It can include text, buttons, URLs Butttons, lists to reply

func SendGenericTemplateMessage

func SendGenericTemplateMessage(template []*fbmodelsend.TemplateElement, recipient string, accessToken string, msgType int) (err error)

SendGenericTemplateMessage - Sends a generic rich message to Facebook user. It can include text, buttons, URLs Butttons, lists to reply

func SendImageMessage

func SendImageMessage(url string, recipient string, accessToken string, msgType int) (err error)

SendImageMessage - Sends image message to a recipient on Facebook Messenger

func SendPersonalFinanceUpdateMessage

func SendPersonalFinanceUpdateMessage(text string, recipient string, accessToken string) (err error)

SendPersonalFinanceUpdateMessage sends a Finance Update information to recipient

func SendQuickReply

func SendQuickReply(text string, options []*fbmodelsend.QuickReply, recipient string, accessToken string, msgType int) (err error)

SendQuickReply sends small messages in order to get small and quick answers from the users

func SendTextMessage

func SendTextMessage(text string, recipient string, accessToken string, msgType int) (err error)

SendTextMessage - Send text message to a recipient on Facebook Messenger

func SendTypingMessage

func SendTypingMessage(onoff bool, recipient string, accessToken string, msgType int) (err error)

SendTypingMessage - Sends typing message to user

func SendURLButtonMessage

func SendURLButtonMessage(text string, buttonTitle string, URL string, recipient string, accessToken string, msgType int) (err error)

SendURLButtonMessage - Sends a message with a button that redirects the user to an external web page.

func VerifySignature

func VerifySignature(appSecret string, bytes []byte, expectedSignature string) bool

VerifySignature it verifies Fb Messenger's message signature to avoid spams and DDoS attacks

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL