-
-
Notifications
You must be signed in to change notification settings - Fork 399
Deploy with Heroku
Tuhin Kanti Pal edited this page May 9, 2022
·
27 revisions
1. You Have to create a WhatsApp session that Whatsbot can start. You can do it by cloning this repo and run genToken.js
, You can follow these steps also π
- Open it in any terminal (NodeJS and Npm) and run the following codes
git clone https://github.com/TheWhatsBot/WhatsBot.git
cd WhatsBot
npm install
npm run gentoken
- Put your
SESSION_KEY
- You will see a QR code, scan this QR code from your Phone's Whatsapp Web QR scanner.
- After authenticated you will see a new file
session.secure
has been created in the root directory.
Go to https://ssh.cloud.google.com
- Run This
docker run -p 8080:8080 -it jeeetpaul/whatsbot-session
- Scan QR Code with Whatsapp and see your personal chat for the session
- Open your 8080 Port
- Go to
https://8080-your-cloudshell.cloudshell.dev/session.secure
and downloadsession.secure
Example:
https://thetuhin.com/session.secure
- Open
https://cloud.mongodb.com
- Click the
Try MongoDB Cloud Now
Button - 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
Free
and clickCreate a Cluster
- Select AWS North America or Europe server only because Heroku's server is also located there and click
Create Cluster
- Now you will see a cluster is creating
- click
Network Access
in Sidebar & clickAdd IP Address
- Now click
ALLOW ACCESS FROM ANYWHERE
andConfirm
that - click
Database Access
in Sidebar & clickAdd New Database User
- Now in Password Authentication Method type any Username and a Password and click
Add User
- click
Clusters
in 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
- Click this button π
- Give an APP Name
- Select the server according to your MongoDB server's Location, It will Speed Up Database intensive works
-
SESSION_URL
-secure.session
Direct url -
SESSION_KEY
- Encrypted key for which you typed after running thenpm run gentoken
-
DEFAULT_TR_LANG
- It is the default translation language for Translator Module. Default Value isen
-
MONGODB_URL
- MongoDB url you grabbed before -
PMPERMIT_ENABLED
- Enable Pmpermit or Disable it. Writetrue
orfalse
. Default Value istrue
-
OCR_SPACE_API_KEY
- OCR Space API Key. You can get the API Key from here
- Open
https://cron-job.org
its free - Click Sign Up and Complete the Signup
- After that click
cronjobs
in navigation header & clickCreate Cron Job
- Give your heroku application url
- Schedule it in every 15 minutes
- Everything rest will be default
- click
Create Cronjob
to create a cron job