Este projeto usa como base o Venom-bot, um navegador virtual sem interface gráfica que abre o whatsapp web e executa todos os comandos via código possibilitando assim a automação de todas as funções.
sudo apt install -y gconf-service 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 build-essential apt-transport-https libgbm-dev
- para instalar todas as dependencias necessárias no sistema
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt install git nodejs yarn
- para instalar git, nodejs e yarn
git clone https://github.com/billbarsch/myzap.git
cd myzap
npm install
cp .env-example .env
node index.js
npm install pm2 -g
pm2 start index.js
pm2 startup
http://localhost:3333/start?sessionName=session1
http://localhost:3333/qrcode?sessionName=session1&image=true
- png
http://localhost:3333/qrcode?sessionName=session1
- json (base64)
(async () => {
const response = await fetch('http://localhost:3333/sendText', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(
{
sessionName: "session1",
number: '556334140378',
text:"Hello\nWorld"
}
)
});
const content = await response.json();
console.log(content);
})();
(async () => {
const response = await fetch('http://localhost:3333/sendFile', {
method: 'POST',
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(
{
sessionName: "session1",
number: '556334140378',
base64Data:"44696d61", //hexadecimal
fileName:"test.txt",
caption: "Document" //optional
}
)
});
const content = await response.json();
console.log(content);
})();
http://localhost:3333/close?sessionName=session1
sudo apt-get update && sudo apt-get install -y software-properties-common
sudo add-apt-repository universe && sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update && sudo apt-get install -y certbot
sudo certbot certonly --manual --force-renewal -d *.yourdomain.net -d yourdomain.net --agree-tos --no-bootstrap --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory