Easy deploy your bot, steps in the bottom.
Requirements :
- Git
- Heroku account
- Heroku cli
Download and install git from (https://git-scm.com/downloads)
-
Create account on heroku. (https://signup.heroku.com/)
-
After login on heroku dashboard create an app on heroku (https://dashboard.heroku.com/apps)
-
In the 'Resources' tab search for 'Heroku Postgres' in Add-ons and add it to your heroku app.
-
In the 'Deploy' section download Heroku CLI or from (https://devcenter.heroku.com/articles/heroku-cli#download-and-install)
- After downloading and installing Heroku CLI in your system login to heroku cli using
heroku login
in command prompt or powershell. - Add ffmpeg (for sticker support) in your heroku app using
heroku buildpacks:add https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git -a <your-app-name>
- After adding ffmpeg now add 'Heroku Buildpack for Node.js' using
heroku buildpacks:add https://github.com/heroku/heroku-buildpack-nodejs.git -a <your-app-name>
- Now download or clone the whatsapp-bot repo by
git clone https://github.com/Imrany00/whatsapp-bot-md-fork.git
- Now enter in whatsapp-bot directory using
cd whatsapp-bot-md
in command prompt or terminal. - Create the remote region using
heroku git:remote -a <your-app-name>
- Now push the local repo in your heroku app using
git push heroku master
- Now after the deploy process is completed use
heroku logs -a <your-app-name> --tail
to get real time logs from heroku app. - In real time logs it will automatically ask you for login using qr code just simple scan the qr code using your whatsapp web section, and you are done.
Now Bot will start working!! Work even if the device is offline!!
- It count messages of every member in all the groups in DB. (just the message count, not actual text message), so that we can see stats like top members, top groups, etc.
- It also forwards every sticker that is sent to any of the PVX groups to another group i.e. Sticker Only, where members can have access to different different types of stickers 24x7.
- It posts tech news to tech group and trending india news to study group every 20 min.
- It notifys the birthday in the community group when new day starts.
- It welcomes new users when joined with some questions/rules.
- It automatically bans any user with a non-Indian number (any number without +91 code).
Public Commands | Description | Alias |
---|---|---|
!help |
Display public commands | !h |
!helpa |
Display admin commands | |
!helpo |
Display bot owner commands | |
!donation |
Get Donation details | |
!alive |
Check bot is ON or OFF | !a |
!feedback |
Get feedback form | |
!votecommand |
Get list of vote commands | !vc |
!pvxlink |
Get group links of PVX | |
!dev |
Get the contact of dev | |
!cricketcommand |
Get list of cricket commands | !cc |
!source |
Get the bot source | |
!steal |
Change sticker name to PVX BOT |
Member Commands | Description | Alias |
---|---|---|
!count |
Know message count in current group | |
!total |
Know message count in all PVX groups | |
!rank |
Know message count & rank in all PVX groups | |
!ranks |
Know ranks list of PVX groups | |
!totalg |
Know message count group wise in PVX groups | |
!sticker |
Create sticker from different media types | !s |
!image |
Create image from sticker | |
!imagesearch |
Search image from any name | !is |
!searchsearch |
Search sticker from any name | !ss |
!song |
Get any song in good quality | |
!insta |
Get insta reels or post videos | !i |
!fb |
Get facebook videos | |
!ytv |
Download youtube videos | |
!yta |
Download youtube audio | |
!technews |
Get latest Tech news | |
!drive |
Get GDrive files direct link | |
!quote |
Give a random quote | |
!gender |
Get gender from first name | |
!score |
Give Cricket score | |
!scorecard |
Give Cricket scorecard | !sc |
!startc |
Start Cricket score updated | |
!stopc |
Stop Cricket score updated | |
!startvote |
Start voting in group | |
!vote |
Vote for a choice | |
!checkvote |
Check status of current voting | !cv |
!stotvote |
Stop voting and see result | |
!votepvx |
Vote for a choice for all PVX groups | |
!checkvotepvx |
Check status of current voting for all PVX groups | !cvpvx |
!rules |
Get PVX groups rules | !r |
Admin Commands | Description | Alias |
---|---|---|
!add |
Add member to group | |
!kick |
kick member from group | !ban |
!mute |
Mute the group | |
!unmute |
Unmute the group | |
!delete |
Delete anyone message | !d |
!tagadmins |
Tag all admins of group | !ta |
!warning |
Give warning to user | !warn |
!enable |
Enable command for current group | |
!disable |
Disable command for current group | |
!pvxg |
Get message count stats of PVX groups | |
!pvxm |
Get members message count stats of current PVX group | |
!pvxt |
Get top members message count stats of PVX groups | |
!pvxt5 |
Get top 5 members message count stats of all PVX groups | |
!zero |
Get members list with 0 message count | |
!pvxstats |
Get stats of PVX groups | |
!blacklist |
Get blacklist numbers | |
!blacklistadd |
Add number to blacklist | !bla |
!blacklistremove |
Remove number from blacklist | !blr |
Owner Commands | Description | Alias |
---|---|---|
!donationadd |
Add Donation details | !da |
!countstats |
Get stats of number of command used | |
!test |
execute code with whatsapp directly | |
!broadcast |
Broadcast a message to all groups | !bc |
!tagall |
Tag all members in group | |
!gname |
Save group names to DB | |
!tg |
Make TG to WA stickers | |
!stg |
Stop TG to WA stickers | |
!groupbackup |
Take group backup in DB | |
!startvotepvx |
Start voting for all PVX groups | |
!stotvotepvx |
Stop voting and see result for all PVX groups |
-
CRICKET SCORES:
Put match id in starting of group description.
Get match ID from cricbuzz url, like https://www.cricbuzz.com/live-cricket-scores/37572/mi-vs-kkr-34th-match-indian-premier-league-2021 so match ID is
37572
EXAMPLE:
Create a .env
file for enviromental variables in local directory with following values without quote
myNumber = "your-number-to-receive-all-updates"
DATABASE_URL = "get-from-heroku-dashboard"
Get value of database_url from Heroku dashboard > settings > reveal config vars
Run the index file by node index.js
Since heroku uses:- Dyno sleeping in which if an app has a free web dyno, and that dyno receives no web traffic in a 30-minute period, it will sleep. In addition to the web dyno sleeping, the worker dyno (if present) will also sleep. and if a sleeping web dyno receives web traffic, it will become active again after a short delay (assuming your account has free dyno hours available) You can use (http://kaffeine.herokuapp.com) to ping the heroku app every 30 minutes to prevent it from sleeping.
Your bot will be deployed on heroku but still you need to install heroku locally to scan QR code
- Download Heroku CLI from here
- Open terminal
- Type command
heroku login
and give access - Type command
heroku logs -a <your-app-name> --tail
Now you'll see QR code, scan with your device and bot will start working!
-
To get owner commands
Go to heroku daskboard then settings then config vars
Add KEY as
myNumber
and VALUE as254754423664
(your number with country code and no + sign)