facebookUtils

Methods

(inner) generateButtonObject(type, titles, payloads) → {array}

Generates button objects

Source:
Parameters:
Name Type Description
type string

type of button according to the Send API.

titles array

array of strings from which to create text buttons

payloads array

array of objects {title, payload} to override using titles as payloads

Returns:
Type:
array

array of messenger button objects

(inner) generateButtonTemplate(text, titles, payloads) → {object}

Generate button template for quick Yes/No answers. Max 3 buttons.

Source:
Parameters:
Name Type Description
text string

the question

titles array

array of strings that will make the button titles

payloads array

array of objects {title, payload} to override using titles as payloads

Returns:
Type:
object

a messenger button template object

(inner) generateQuickReply(text, replyArray) → {object}

Generate a messenger quick reply

Source:
Parameters:
Name Type Description
text string

the question text

replyArray array

an array of up to 11 objects that is, the answers

Returns:
Type:
object

a quick reply object