Simple chatbot for grabbing Kanto train information using facebook messenger platform.
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y build-essentialsudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
sudo apt-get update
sudo apt-get install -y mongodb-org- Create a facebook page
- Create a facebook application
- Add Messenger product to the application
- Generate a page access token for the application
- Clone this project
git clone https://github.com/qmau-me/kanto-rosen.git- Set the
appSecretandpageAccessTokeninconfig/default.jsonwith page access token and app secret from application admin dashboard.
- Set a
validationTokenfor webhook validation. - Replace values for
APP_IDandPAGE_IDinpublic/index.html.
- Run the project
npm install
node app.js- Start MongoDB
sudo service start mongod- Follow those steps to use ngrok setting up an reachable endpoint for the Facebook messenger.
- Config webhook endpoint with https link from the ngrok terminal
ngrok http 5000
- Subscribed to created page
- Enjoy the chatbot on messenger page
- help: show all chatbot options
- list: list all subscribed line
- unsub: chose to delete a line from the subscribed line list
See the LICENSE file in the root directory of this source tree. Feel free to use and modify the code.



