boilerplate for facebook messenger bots on sails js
Upon deploying you will have an empty website with a deactivated API and a ready to implement Messenger chat bot 🚀
The app is configured to be ready to deployed on RedHat openShift, but you can tweak it and deployed on the hosting provider of your choice
Fork & Clone this repository and run npm install
git clone https://github.com/Freeways/messenger-bot-sails
cd messenger-bot-sails
npm install
Create your page and bot on developers.facebook.com
Edit your config/messenger.js with the values you've generated from facebook
Start implementing your bot logic at api/controllers/BotController.js
First you would like to take a look at Facebook Send API.
To respond within the api/controllers/BotController.js you can use function sendAPI.send(yourResponse, aCallback) where your response is a valid message (see the link above) and aCallback is function to be executed after sending.
Alternatively, a better practice would be to add methods to the api/utils/sendAPI.js
First keep on mind that the API does not come with an authentication system so it is open to public (unsecure).
To activate the API on the file config/blueprints.js please change the values of actions, rest and shortcuts to true.