AskSusi Facebook Messenger Bot
This is the Facebook messenger bot for AskSusi.
Technology Stack
node.js
and Express
.
Getting Started
It's easy for you to create your own facebook messenger bot and integrate susi's API into it. You can read the documentation as prepared by the Messenger team.
Messenger bots uses a web server to process messages it receives or to figure out what messages to send. You also need to have the bot be authenticated to speak with the web server and the bot approved by Facebook to speak with the public.
Setup your own Messenger Bot
-
Fork this repository.
-
Create a facebook page here.
- Create a new Google Cloud or Heroku App.
- Connect the heroku app to the forked repository.
- Deploy on development branch. If you intend to contribute, it is recommended to Enable Automatic Deploys.
- Create or configure a Facebook App or Page here
- Get started with Messenger tab in the created app.
- In the Page Access Token select the fb page that you created and generate the token and save it somewhere for future use.
- Now, go to the heroku app, select the settings tab and add the environment variable as shown, where key is FB_PAGE_ACCESS_TOKEN and value is the token generated in the previous step.
- Create a webhook on the facebook app dashboard. The Callback url should be https://<your_app_name>.herokuapp.com/webhook/ and rest should be as shown in the image below.
- Go to Terminal and type in this command to trigger the Facebook app to send messages. Remember to use the token you requested earlier.
curl -X POST "https://graph.facebook.com/v2.6/me/subscribed_apps?access_token=<PAGE_ACCESS_TOKEN>"
- Go to the facebook page created and locate 'Message Now' or go to https://m.me/PAGE_USERNAME
- Enjoy chatting with Susi.
Branch Policy
The default branch is development
, so make sure you contribute only on this branch.
License
This project is licensed under the GNU GENERAL PUBLIC LICENSE, Version 3. Please find more info in our license document.