Description
This service communicates with whatsapp web, using the puppeteer. This bot is inspired by 99% of the bots I see out there on the internet, from e-commerces
Credits to the author of the library PEDRO
Special thanks for the structure CAIO
1 - API
The api has nothing to do with the service, the only thing it does is to communicate with the postgres database, I decided to post it too.
Create table into Postgres
$ npx knex migrate:latest
Insert data into Postgres
$ npx knex seed:run
Sample request using CURL in the command line/terminal:
curl http://localhost:4001/api/user/38581407838 | python3 -m json.tool
Access the documentation for all methods in the swagger 🥇
http://localhost:4001/api/docs
1 - SERVICE
Scan QRCODE
Attention you need to do this, right after running npm install in the Service folder, open service/node_modules/whatsapp-web.js/src/Client.js and add these lines
---LINE 43
this.lastMessage = null;
---LINE 441 up until 443
setPrevMessage(status){
this.lastMessage = status;
}
This function is for the puppeteer to go back and forth between pages.
Installations
Requirements
You will need to install some stuff, if they are not yet installed in your machine:
Install through Github
Best way to install is to clone it from Github
To clone/download the boilerplate
$ git clone https://github.com/lucioerlan/rest-to-soap.git
After cloning
$ cd rest-to-soap
Install all of the projects dependencies with:
$ npm install
copy the .env-examples file to .env
$ cp .env-examples .env
running
$ npm start
Running with Docker 🐳
$ docker-compose up
🔓 Licença
MIT © Erlan Lucio