Easily build conversations for Twilio, Facebook Messenger, and more.
npm install convo-builder
You can also check out convo-builder directly from Git:
After cloning the Git repository, you have to install the node dependencies. Navigate to the root of your cloned repository and use npm to install all necessary dependencies.
var convo = ;convo;var greeting = 'Hi! Here\'s a survey your coach wanted me to send you.';var messages ='Did you eat cake at least once this week?''What one food would you most like to eat next week?''On a scale from 1 to 5, how happy were you with this week\'s meal plan?';var conclusion = 'Thanks for answering my questions! Enjoy the rest of your day.';var options =provider: 'twilio'providerOptions:phoneNumber: '<THE PHONE NUMBER YOU WISH TO MESSAGE>';convo;
Takes an object that is used to configure convo-builder and the providers.
port: <Port number to listen for messages on>twilio:ACCOUNT_SID: '<Twilio account SID>'AUTH_TOKEN: '<Twilio auth token>'phoneNumber: '<Twilio phone number>'messenger:VERIFY_TOKEN: '<Verify token for Facebook messenger>'PAGE_ACCESS_TOKEN: '<Page access token for Facebook messenger>'
Send the user a message using the provided options, takes an optional callback that runs after the message has been sent.
Sends the user an array of messages once at a time using the provided options, calls the provided callback with the user's response to each message in turn. Takes an optional callback that runs after all of the messages are sent.
provider: '<Either messenger or twilio>'providerOptions:phoneNumber: '<User phone number>' // For twiliorecipientId: '<User facebook id>' // For Facebook messenger