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
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.
$ npx knex migrate:latest
$ npx knex seed:run
curl http://localhost:4001/api/user/38581407838 | python3 -m json.tool
http://localhost:4001/api/docs
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.
You will need to install some stuff, if they are not yet installed in your machine:
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
$ cp .env-examples .env
running
$ npm start
$ docker-compose up
MIT © Erlan Lucio