Skip to content
Node.js facebook chat bot for kanto transit
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
public
views
.gitignore
.jshintrc
CHANGELOG.md
LICENSE
README.md
app.js
package-lock.json
package.json
tos

README.md

Kanto train info chatbot

Simple chatbot for grabbing Kanto train information using facebook messenger platform.

Setup

Node.js

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y build-essential

Mongodb

sudo 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

Facebook messenger Platform

pat

Project setup

  • Clone this project
git clone https://github.com/qmau-me/kanto-rosen.git
  • Set the appSecret and pageAccessToken in config/default.json with page access token and app secret from application admin dashboard.

token

  • Set a validationToken for webhook validation.
  • Replace values for APP_ID and PAGE_ID in public/index.html.

Run

  • 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

ngrok webhook

  • Subscribed to created page
  • Enjoy the chatbot on messenger page
<iframe src='https://gfycat.com/ifr/SmartOrdinaryBluebreastedkookaburra' frameborder='0' scrolling='no' allowfullscreen width='640' height='893'></iframe>

via Gfycat

Command list

  • help: show all chatbot options
    • list: list all subscribed line
    • unsub: chose to delete a line from the subscribed line list

License

See the LICENSE file in the root directory of this source tree. Feel free to use and modify the code.

You can’t perform that action at this time.