MongoDB Guide
- Follow steps down below to setup MongoDB
- Go to MongoDB cloud atlas
- Sign up if you don't have an account already or log in if you have one already. (Optional): If you don't want to use your email, go to https://temp-mail.org/en/ and generate a temporary disposable email address uwu)/
- Create a new cluster on Mongo Atlas. [It takes time, so don't worry]
- After creating a cluster, click on the 'CONNECT' button on the cluster which you've created.
- On Setup connection security, I'd recommend you to add 'Your Current IP Address' for security concerns but if you are not willing to go through a little bit of pain, then simply add 'Access from anywhere. Also, you can change this anytime by opening your "IP Access list tab".
- Then, create a database user, fill up the name and password and MAKE SURE TO REMEMBER THEM.
- Click on the "Choose a connection method" and then click on the "Connect Your Application" option.
- Finally, on the "Connect".
- Copy the connection string that is provided below and paste it somewhere and replace with 'the password you added while creating database user', also make sure to remove '< >' these from . This will be your MONGO CLUSTER URI.
mongodb+srv://AKU:Aku_sempai@cluster0.evdz6.mongodb.net/?retryWrites=true&w=majority
- That's it You now have a MongoDB cluster hosted on Mongo-Atlas. You can use this cluster for other projects too.
Heroku Guide
- Go to Heroku and sign up if you already sign in then follow these steps
- Scroll down a bit and you will see the "Deploy To Heroku" Button
- Click on it and login or sign up for Heroku
- Enter the following fields
KEY VALUE NAME NAME_OF_THE_BOT PREFIX PREFIX_OF_THE_BOT SESSION BOT_SESSION MODS BOT_ADMINS_NUMBER (should be seperated by a comma and a space) MONGO_URI YOUR_CLUSTER_URI
PREFIX
: Prefix of the botBOT_NAME
: Name of the botMONGO_URI
: A secret String for MongoDB connection. (Required)MODS
: Number of the users who should be the admins of the bot (should be in international format without "+" eg(92********) and multiple numbers should be separated by a comma and a space). Example - 1234567890, 91245670325 (you shouldn't add "@s.whatsapp.net" at the end of each numbers)SESSION
: Session of the bot
- Wait for the building to finish, you should always keep an eye on log messages, you can find log messages in the Dashboard -> More -> View logs.
- After it builds, go to "Resources" and search "Heroku Postgres" click on it then new pop up will appear "Submit Order Form" <- click on it and the go to "Open App".
- A QR Code Will Show Up.
- Open WhatsApp on your phone -> Click on the 3 Dots on the top Right -> Click on WhatsApp Web -> Click on "Link a Device" and scan the QR from the previous step.
- Your heroku app can fall asleep so for keeping it awaken add your app to (Kaffeine).
It pings your Heroku app every 30 minutes so it will never go to sleep.