" NOTE: I can't guarantee you will not be blocked by using this method, although it has worked for me. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe "
Also in this repo those node_modules and ffmpeg just demo how folder looks like.
-
Whatsapp-web.js
This is a Whatsapp bot based on Whatsapp-web.js and implemented to do some advanced work.
Credits to Pedro S Lopez
So please read all documentation from Whatsapp-web.js first
-
Google-translate-api
This bot also uses google-translate-api-x
Credits to AidanWelch
- All features from Whatsapp-web.js
- Translate any language to any language
- Make Whatsapp stickers within chat
- Openai chat and Image generation
- Node v12+ is required
- Install Gitbash
- ffmpeg required
-
Create a folder/directory and name it like wabot
-
Open terminal in that folder/directory and run these commands
npm init -y
npm i whatsapp-web.js
npm i qrcode-terminal
npm i openai
npm i google-translate-api-x
npm install mime-types
Also buttons and lists to get work you have to run this
npm i git+https://github.com/pedroslopez/whatsapp-web.js#fix-buttons-list
if above code didn't get worked buttons or lists try this
npm i github:pedroslopez/whatsapp-web.js#fix-buttons-list
Also if you are running on Linux server you must use following two commands
sudo npm install -g puppeteer --unsafe-perm=true -allow-root && sudo apt install chromium-browser -y
and
sudo apt update && sudo apt install -y gconf-service libgbm-dev libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
-
Also to make stickers need ffmpeg.
If you are a windows user download it from here and extract ffmpeg.exe to folder that created (wabot)
If you are a linux user run this command
sudo apt install ffmpeg
-
Then download index.js and move it to folder/directory
-
To use openai features you have to get api key. You can get api key from here. Then add your api key to system as a environment variable to OPENAI_API_KEY . In linux just paste api key in code in relevant places.
After following all installation guides change index.js as your need. Also refer Guides and Documentation from whatsapp-web.js.
Then run node index.js in terminal. Scan qr and link your device.
And that's all. Use your whatsapp bot