This is a messenger bot which will assist you to count your next birthday down. This bot also uses some basic natural language processing from facebook to process the user's sentiments.
You can check out the demo messenger bot at http://m.me/106874377597549. This demo bot service is deployed to Heroku Cloud Platform and its database is hosted on JawsDB MySQL. You can check out the main interaction from the gif below.
Note: If the messenger bot is not working properly, feel free to contact me at christzenleonardy@gmail.com.
To see the list of services you can use from this API Web Service, please check out our documentation.
Note: If the hyperlink doesn't work, you can open it at https://documenter.getpostman.com/view/6370911/SzRxV9xE.
If you plan to run it by yourself, you can follow these steps.
Firstly, clone this repository.
git clone https://github.com/christzenleonardy/messenger-bot.git
Move to the repository folder using cd
and install the required dependencies.
npm install
If you don't plan to deploy your app at cloud-based service (Heroku, AWS EC2 instance), you need to install ngrok because it will be used for exposing your localhost server to the web.
Before running the service, make sure you have a working zen personal assistant database. If you don't have one, you can import zen_personal_assistant.sql
into your MySQL database management system.
Note: If you plan to run your database on different host, make sure to update the host, user, and password at conn.js
.
npm test
npm start
After starting the service, try to hit http://localhost:3000
or your host:port
of choice. If you get the response below, your service is good to go!
{
"status": 200,
"values": "Hello from the Node JS RESTful side!"
}
Feel free to deploy your service at a cloud-based service like Heroku or AWS EC2 instance, or some other (just make sure you have HTTPS support). To get you started faster, we are going to use our own hardware as the server. After you run your service on localhost, you can use ngrok to expose your localhost server to the web. You can start an HTTP Tunnel on port 3000 or your port of choice with the following command:
./ngrok http 3000
You can use the URLs in red bracket for your webhook URL at the next step.
You can follow the guide here at https://developers.facebook.com/docs/messenger-platform/getting-started/app-setup.
VERIFY_TOKEN
at controller.js
inside verifyWebhook
functionprocess.env.PAGE_ACCESS_TOKEN
.>= 95%