Giter Club home page Giter Club logo

whatsapp-bot-ts's Introduction

Multi Device Whatsapp Bot in TS ๐Ÿค–

Click to show Webpage

Setup:- ๐Ÿš€

  1. Download and install Git
  2. Download and install Nodejs
  3. Open terminal and run - git clone https://github.com/Shubhamrawat5/whatsapp-bot-ts
  4. Open bot folder - cd whatsapp-bot-ts
  5. Install all dependencies - npm install

Local Run:- ๐Ÿš€

  1. Create account on elephantsql for Database.

  2. After login, get the database URL from details section. It'll be like: postgres://[email protected]/xyz

  3. Create a local .env file with following variables and save the file. [You can check all the .env variables in .env.sample file]

    DATABASE_URL = "postgres://full_db_url"
    OWNER_NUMBER = "911234567890"
    NPM_CONFIG_PRODUCTION = "false" // For heroku only

  4. Run command in teminal to create DB tables - npm run db

  5. Install typescript - npm install -g typescript

  6. Install ts-node to run directly - npm install -g ts-node

  7. Start the bot - npm run dev

  8. It'll ask for QR code scan, scan it and bot will start working.

NPM Commands:- ๐Ÿš€

Create all DB tables -> npm run db
Run in dev environment -> npm start or npm run dev
Run in prod environment -> npm run start-prod
Check linting errors -> npm run lint
Fix linting errors -> npm run lint-fix

Features:- ๐Ÿš€

  1. 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.
  2. 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.
  3. It posts tech news to tech group and trending india news to study group every 20 min.
  4. It notifys the birthday in the community group when new day starts.
  5. It welcomes new users when joined with some questions/rules.
  6. It automatically bans any user with a non-Indian number (any number without +91 code).

Commands:- ๐Ÿš€

Default prefix: !

Public Commands Description Alias
!help Display public commands
!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
!tagadmins Tag all admins of group !ta
!sticker Create sticker from different media types !s
!ai Ask questions to AI
!text Create sticker from text
!insta Get insta reels or post videos !i
!ytv Download youtube videos
!yta Download youtube audio
!song Get any song in good quality
!rank Know message count & rank in all PVX groups
!ranks Know ranks list of PVX groups
!count Know message count group wise in PVX groups
!image Create image from sticker
!imagesearch Search image from any name !is
!searchsearch Search sticker from any name !ss
!fb Get facebook videos
!technews Get latest Tech news
!drive Get GDrive files direct link
!quote Give a random quote
!horo Check today's horoscope
!gender Get gender from first name
!score Give Cricket score
!scorecard Give Cricket scorecard !sc, !sb
!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
!promote Promote to admin
!demote Demote from admin
!delete Delete anyone message !d
!bday Check today's birthday
!warning Give warning to user !warn
!warninglist Check warning of all members !warnlist
!warningreduce Reduce warning to user !warnreduce
!warningclear Clear all warning to user !warnclear
!warningcheck Check warning to user !warncheck
!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
!pvxtm Get members message count stats with rank of current PVX group !pvxmt
!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
!tagall Tag all members in group
!gname Save group names to DB
!websitelink Enable/disable group link in PVX website !wl
!setlink Set all group name & links in DB
!getlink Get all group name & links from 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 the starting of group description
    Get match ID from cricbuzz url, Example: https://www.cricbuzz.com/live-cricket-scores/37572/mi-vs-kkr-34th-match-indian-premier-league-2021, so match ID is 37572

References:- ๐Ÿš€

whatsapp-bot-ts's People

Contributors

salman0ansari avatar shubhamrawat5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

whatsapp-bot-ts's Issues

Commands not responding or working

i have followed the steps given in the Readme and a bot was also initialzed on the given whatsapp number but the commands are not responding/working and i am getting an error like this
Adding default milestones Login data updated! /workspaces/whatsapp-bot-ts/src/functions/addDefaultMilestone.js:5 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } ^ TypeError: Cannot read properties of undefined (reading 'participants') at /workspaces/whatsapp-bot-ts/src/functions/addDefaultMilestone.js:21:24 at Generator.next (<anonymous>) at fulfilled (/workspaces/whatsapp-bot-ts/src/functions/addDefaultMilestone.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:95:5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.