Coder Social home page Coder Social logo

prince-mendiratta / botsapp Goto Github PK

View Code? Open in Web Editor NEW
5.5K 35.0 1.3K 757 KB

Your personal assistant, on WhatsApp! The most user friendly userbot for the platform!

License: GNU General Public License v3.0

JavaScript 6.35% Dockerfile 0.16% TypeScript 93.49%
whatsapp bot userbot botsapp whatsapp-bot baileys-bot

botsapp's Introduction

πŸ’ BotsAppπŸ’ 

Your Personal Assisstant, on WhatsApp!


GitHub top language GitHub release GitHub contributors GitHub closed pull requests GitHub pull requests GitHub Repo stars GitHub repo size

Docker Pulls Docker Image Size

BotsApp is an optimized and easy-to-use WhatsApp UserBot written in Node.js.

Utilize your personal chat assistant/group manager to make the most out of WhatsApp.

Documentation

Documentation Link

Tutorial

Here's a tutorial to set up BotsApp on your own account in less than 3 minutes. For now, the Multi Device Bot can only be used locally, the tutorial for which is attached below.

How to deploy

Multi Device

Deployment

Only local deployment is working for now!

Easiest Way

You can deploy BotsApp in minimal time without any prior knowledge using this method.

  1. Head over to BotsApp's Official website and create an account on heroku using your email ID.
  2. Once logged in, click on the "Deploy BotsApp" button in the sidebar.
  3. Scan the QR code shown using your WhatsApp account (3 dots on top right corner -> Linked devices -> LINK A DEVICE). Click on the 'Continue' button once done.
  4. Once the bot is linked to your account, you will come across a form which can be used to manage settings/permissions of BotsApp. If required, change the form fields. Then, click on the submit button.
  5. Wait for 1-3 minutes for the bot to start. This is a one time process. Try using the '.alive' command in any of your chats to verify whether your bot has been deployed succesfully.

Voila! You have deployed your bot in 5 easy steps. Once the bot has started successfully, you'll see a integration message on your whatsapp account.

Manually on Heroku

Deployment to heroku using the button is not working for now!

You can deploy the bot the heroku yourself using the button below!

Deploy To Heroku

Using Docker locally

To follow this method, you will need to have docker installed on your machine and have some experience using docker.

To host the bot on your own device using docker, follow the following steps on your terminal / command prompt -

wget -O BotsApp.tar.gz https://github.com/Prince-Mendiratta/BotsApp/archive/refs/tags/v2.0.0-beta.tar.gz
tar -xvzf BotsApp.tar.gz
cd BotsApp-2.0.0-beta
docker build -t botsapp .
docker run --rm --name botsapp botsapp

This will create a container running BotsApp. You'll have to scan the QR at least once.

The GNU/Linux Legacy Way

To use this method, you will need ffmpeg, nodejs, npm installed on your device.

To run the bot on your device manually, you can use the following commands -

git clone https://github.com/Prince-Mendiratta/BotsApp.git
cd BotsApp
yarn
npm start

Scan QR Code again

If you're having issues when running locally it is recommended to scan the code again. To get the QR code again, follow these commands -

rm -rf BotsApp.db session.data.json
npm start

Support and Discussion groups

Feel free to post your queries or concerns on any of the discussion forums mentioned below:

Join WhatsApp Group

Join Telegram Group

Join Telegram Channel

Contributors


Prince Mendiratta

Project Lead Developer

Prashant Singla

Core Developer

Keshav Pahwa

Core Developer

Johann Jose

Core Developer

Mohit Singh Rana

Core Developer

Neeraj Patel

Moderator

Inspiration

Copyright & License

Legal

This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by WhatsApp or any of its affiliates or subsidiaries. This is an independent and unofficial software. Use at your own risk.

botsapp's People

Contributors

j0h4nn1410 avatar keshav-pahwa avatar mohit161220 avatar prashant-singla avatar prince-mendiratta avatar thegeek-dev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

botsapp's Issues

Upgrade bot

Please can you help us modify it in a way that when the bot is sending msg it should be tagging the msg it is replying to.

Unhandled Exception

if in any case, we try to demote the userbot itself, the exception isnt catched and bot crashes., probably a bug.

[BUG] - audio doesn't work on iphone

the audio that are made by the .tts command don't play on iphone. they might work of we change the default audio to mp3 or some supported audio formats.

Banned ln heroku

I used botsapp for a while but now out of no where i got suspended on heroku I don't know why.I made 4 accounts and each one is getting banned in less than 30mins from using the bot whole on public, on private it seems fine.
Edit: on private too but after like an hour

Issue with IOS

Basically The Voice files

  • Songs
  • TTS
    are unplayable in IOS, maybe there's some extension issue.,but for now its not working in IOS

BotsApp

Your personal assistant, on WhatsApp!

Does not work with Multi-Device Beta

With the multi-device beta version of WhatsApp, this bot does not work. The WhatsApp app scans the QR code once and displays "scan code again". After that, nothing happens.

Add a security policy

Hey there!

I belong to an open source security research community, and a member (@k0imet) has found an issue, but doesn’t know the best way to disclose it.

If not a hassle, might you kindly add a SECURITY.md file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.

Thank you for your consideration, and I look forward to hearing from you!

(cc @huntr-helper)

New features

We also need it to perform some little gaming options to make it more fun.

App deletion

How to delete the created the botsapp apps
please help

[Feature Request] Blacklisting admin from using bot.

Hi is it possible to add vulnerability to blacklisting admin in the near future? The reason is admin is immune to .abl command and there is unwanted admin that abuse my bot (there is too many admins and .abl to the group command only work for non-admins) So I hope this feature would be great

[Feature Request] Downloading Books

I think A nice feature the bot could have is to have a command that allows the user to download books from the internet ..

Would come in handy with users that like to read a lot and maybe bookclub group chats..
Would this be possible??

whatsapp tells me to scan qr code again

Whatsapp tells me to scan QR code again when I try to connect the bot to my Whatsapp account and even after trying to do that it doesn't work. But it can scan QR codes for whatsapp web without issues.
Please help

Scanned QR with GBWhatsapp

Last days I can't scanned any more, i scan QR and the terminal said just "Stopped" and nothing happens. Changed old value in Config.env with an old code wich worked couple days ago but also "Stopped".

Someone got the same? Or is it possible again with the regular Whatsapp app?

Bot problem

When i log in whatsapp web then BOT is not working . Why this is happening ?

MongoDB support.

Hi is it possible to add MongoDB support into this bot? Thank you!

Add new module, but without any response

The older version of this repo I created some easy modules. Wich I want to change to .ts and put in the latest version.
I hope that someone sees what exactly I am missing in my code, why this don't return anything.

But I don't know what I'm missing, i added a teammaker.ts with the following code:

import Strings from "../lib/db";
import inputSanitization from "../sidekick/input-sanitization";
import Client from "../sidekick/client";
import { proto } from "@adiwajshing/baileys";
import BotsApp from "../sidekick/sidekick";
import { MessageType } from "../sidekick/message-type";
import STRINGS from "../lib/db";

module.exports = {
    name: "teammaker",
    description: STRINGS.teammaker.DESCRIPTION,
    extendedDescription: STRINGS.teammaker.EXTENDED_DESCRIPTION,
    demo: { isEnabled: false },
    async handle(client: Client, chat: proto.IWebMessageInfo, BotsApp: BotsApp, args: string[]): Promise<void> {
        try{
            if(args.length === 0) {
                client.sendMessage(
                    BotsApp.chatId,
                    STRINGS.teammaker.NO_TEXT,
                    MessageType.text
                ).catch(err => inputSanitization.handleError(err, client, BotsApp));
                return;
            }
            if(args.length > 0) {
                const bodySplitter = BotsApp.body.split("|");

                let deelnemers = bodySplitter[0].slice(0, bodySplitter[0].length - 1).split(" ");
                deelnemers.shift();
                const aantalTeams:any = bodySplitter[1];

                function shuffleArray(arr) {
                    arr.sort(() => Math.random() - 0.5);
                }
                
                shuffleArray(deelnemers);

                const spelersPerTeam = deelnemers.length / aantalTeams;
                let teamNumber = 1;
                let i = 0;

                function splitIntoChunk(arr, chunk) {
                    for (i < arr.length; i += chunk;) {
                        let tempArray;
                        tempArray = arr.slice(i, i + chunk);
                        client.sendMessage(
                            BotsApp.chatId,
                            `*β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ Team ${teamNumber} β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘*\n\n${tempArray.join(',\n')}\n\n *β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘*`,
                            MessageType.text
                        );
                        teamNumber++;
                    }
                }
                splitIntoChunk(deelnemers, spelersPerTeam);
            }
        } catch (err) {
            await inputSanitization.handleError(err, client, BotsApp);
        }
    }
}

[Module Backlog] Feature Request - Setting a reminder

It would be really cool if we could set a reminder using this bot.

Something like this - .remind 2 hours (replying to a message)

Then bot will tag me after 2 hours replying to the same message I replied to with command.

[BUG] - song - HTTP 429 Error

Sometimes, when using the .song command, the audio is not downloaded due to HTTP 429 error. The 429 error stands for Too Many Requests. This issue lies with the library being used for downloading songs from youtube. YouTube doesn't allow downloading too many songs, too fast.

A quick fix could be restarting the bot and waiting for a while before retrying download.

This issue will be tackled either by switching to a different library or rate limiting downloads. Will be deliberated upon by the team.

i got an error while running some commands like song, setdp, and sticker. how to fix this?

`[INFO] song command executed.
node:events:371
throw er; // Unhandled 'error' event
^

Error: Cannot find ffmpeg
at /home/runner/botapps/node_modules/fluent-ffmpeg/lib/processor.js:136:22
at /home/runner/botapps/node_modules/fluent-ffmpeg/lib/capabilities.js:123:9
at wrapper (/home/runner/botapps/node_modules/async/dist/async.js:271:20)
at next (/home/runner/botapps/node_modules/async/dist/async.js:5793:24)
at /home/runner/botapps/node_modules/async/dist/async.js:327:20
at /home/runner/botapps/node_modules/fluent-ffmpeg/lib/capabilities.js:116:11
at /home/runner/botapps/node_modules/fluent-ffmpeg/lib/utils.js:223:16
at F (/home/runner/botapps/node_modules/which/which.js:68:16)
at E (/home/runner/botapps/node_modules/which/which.js:80:29)
at /home/runner/botapps/node_modules/which/which.js:89:16
Emitted 'error' event on FfmpegCommand instance at:
at emitEnd (/home/runner/botapps/node_modules/fluent-ffmpeg/lib/processor.js:424:16)
at /home/runner/botapps/node_modules/fluent-ffmpeg/lib/processor.js:433:16
at wrapper (/home/runner/botapps/node_modules/async/dist/async.js:271:20)
at next (/home/runner/botapps/node_modules/async/dist/async.js:5793:24)
at /home/runner/botapps/node_modules/async/dist/async.js:327:20
at wrapper (/home/runner/botapps/node_modules/async/dist/async.js:271:20)
at next (/home/runner/botapps/node_modules/async/dist/async.js:5793:24)
at /home/runner/botapps/node_modules/async/dist/async.js:327:20
at /home/runner/botapps/node_modules/fluent-ffmpeg/lib/capabilities.js:519:16
at /home/runner/botapps/node_modules/fluent-ffmpeg/lib/processor.js:136:16`

WhatsApp Multi-Device Support

In many countries, the multi device feature has been rolled out for production release WhatsApp. Currently, BotsApp doesn't support deploying using the MD WhatsApp. We're working on it currently. The major issue we're facing right now is integrating the deployment for MD on the deployment site, mybotsapp.com, once that is resolved, a new version of BotsApp will be released.

For older versions of WhatsApp, without the Multi Device feature, BotsApp should still work seamlessly.

Enable commands for yourself

Hi There,

I updated to the last version but the older version it was possible to text to yourself and test the commands.
But it's not possible any more, where can I change the code so I can send commands to my self?

BotsApp "forgets" who are the admins in the group.

Update. It seems I was wrong on my steps.

It's not that BotsApp "forgets" who are the admins, but that it doesn't work when the same admin is connected through WhatsApp Web (multidevices enabled on both BotsApp and admin whatsapp).

I managed to sucessfully replicate my issue by issuing a admin command through the phone and having it passing through, but failing to do so when doing through WhatsApp Web.

Ignore the text below. It was how I reported initially, but it's completely wrong, and it was a sequence of unfortunate events that made me think it acted like that.

Starting with a fresh group, I attribute an user the admin status.
He is, then, able to run commands to BotsApp flawlessly.

After a while, running commands to BotsApp will get in response "You need to be an admin to execute this command.".
Nothing shows up differently on the BotsApp command line, no errors to be seen.

Running .admin, BotsApp will reply with the correct list of admins. Demoting and then promiting the person back to Admin status does not help. Stopping the BotsApp Service and restarting BotsApp service also does not help.

The only solution is for that person to leave the group, rejoin, get attributed the admin status, only to then have it happen again after a while.

[Module Backlog] Add command to see dynos, edit config vars through commands

image

Add a feature to check remaining free dynos, edit the variables, change state from "PUBLIC" to "PRIVATE" and vice versa through commands. Only SuperUsers can be able to access the commands.

Heroku API will be required for this, according to my knowledge. You can make it optional to the users who don't want to share the API.

QR wont scan issue

I scan the first time use my fingerprint to unlock device linking but the qr code presented from BotsApp wont scan

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.