js-whatsapp-bot
This is a Whatsapp Chatbot that responds with the top 5 responses on google for any keyword.
Usage
-
Download and install Node.
-
Clone or fork this repository (project).
$ git clone https://github.com/Ileriayo/js-whatsapp-bot.git $ cd js-whatsapp-bot
-
Install the project dependencies found in
package.json
npm install
-
Test the chatbot.
a. Get a Google API key from here. You will need to create a new project from there (Note: you must have a google account to do this).
b. Create a custom search engine from here. Under
sites to reach
, enterwww.google.com
. Give the search engine a name of your choice. Take note of the SearchSee the screenshot below:
c. create a
.env
file. Paste the keys gotten from (a) and (b) above. See the.env.example
file as an example of it's content.d. Run the app
npm run start:dev
(Take note of the Ngrok url displayed on the terminal)e. Create an account on Twilio and navigate to the Whatsapp Sandbox. Follow the instructions from Twilio to get a test whatsapp account. At the end of the setup, paste the url from (d) above into the input field with the label
WHEN A MESSAGE COMES IN
. At the end of the URL, add '/bot
' and hit save.Bonus: You can create a customized link for your Whatsapp chatbot. Use this template:
http://wa.me/<phone-number-from-twilio>?text=<code-to-join-sandbox>
.Send the link to your friends to try out the chatbot.
Technologies Used
- NodeJS
- Google Custom Search API
- Twilio
- ngrok
Author
Ileriayo Adebiyi
Like It?
- Kindly star this repository
๐ ๐ฅบ . It will go a long way. Thanks!๐ค - Click to tweet
Contact
Send me an email to build a bespoke chatbot for unique business needs. Visit my website
License
See license