Deploy in VPS - tuhinpal/WhatsBot GitHub Wiki
- VPS with SSH or Local Machine
- MongoDB
- YouTube Data API Key
- Open
https://cloud.mongodb.com - Click the
Try MongoDB Cloud NowButton - Now you can Fill the Form or Sign Up with Google
- After Successfully Signed Up Type any Organization Name, Project Name and select any preferred language and click
Continue - You can see a Pricing Page select
Freeand clickCreate a Cluster - Select any datacenter's location and any cloud service provider and click
Create Cluster - Now you will see a cluster is creating
- click
Network Accessin Sidebar & clickAdd IP Address - Now click
ALLOW ACCESS FROM ANYWHEREandConfirmthat - Click
Database Accessin Sidebar & clickAdd New Database User - Now in Password Authentication Method type a Username and a Password and click
Add User - Click
Clustersin Sidebar & clickconnect& SelectConnect your application - Now you will see an URL containing
mongodb+srv://Copy that and replace< password >with Your Previously chosen password (If you used any special character in password you have to url encode the password) - You need this MongoDB URL to deploy Whatsbot
- Open
https://console.cloud.google.com/& create a project - Go to
Apis & Servicesand searchYoutube Data Apiyou will foundYouTube Data API v3select that and enable that - Now again go to
Apis & ServicesclickCredentialsand clickCREATE CREDENTIALS& selectAPI Key - An API Key will be displayed Copy That it will need while you deploy Whatsbot
- Require NodeJS and NPM
https://nodejs.org/ - Clone the Repo
git clone https://github.com/TheWhatsBot/WhatsBot.git
- Go To its directory
cd WhatsBot
- Install Requirements
npm install
- Run
genToken.jsand scan the QR using your Phone's Whatsapp Web and copy the output after a successful try
npm run gentoken
-
After authenticated see your personal chat on WhatsApp you will see your session.
-
Rename
example.envto.envand fill everything -
Start the server (Development)
npm start
- Start the server (Using ForeverJS)
npm install forever -g
forever start main.js