API reference

class Messenger()

Messenger

Messenger.pageSend(pageId, recipientId, responseMessage)

Send a response to a user at a page. You probably want to use Response.reply() instead

Arguments:
  • pageId (string) – Page ID
  • recipientId (string) – Recipient ID
  • responseMessage (Object) – The response message to send back
Returns:

Promise – A promise for sending the response

Messenger.send(recipientId, responseMessage)

Send a response to the default page

Deprecated since version 1.4.0: Use Response.reply() instead

Arguments:
  • recipientId (number) – Recipient ID
  • responseMessage (Object) – The response message to send back
Returns:

Promise – A promise for sending the response

Messenger.start()

Start the web server and listen for messages

Returns:void
class Response(messenger, options)

Class representing a Messenger response

Response.reply(responseMessage)

Reply with a response

Arguments:
  • responseMessage (Object) – The response message to send back
Returns:

Promise – When the reply is done