Coder Social home page Coder Social logo

whatsapp-bot's Introduction

[DEPRECATED] WhatsApp Bot

This WhatsApp Bot was made with Python using the Selenium library and PostgreSQL for the database.

Disclaimer: This bot only works in Windows and you need to have Brave Browser installed in your system.

Requirements:

  • All the dependency requirements are included in the requirements.txt file.
  • Install the database from the db.sql file.
  • Add your database credentials in a .env file with the variables:
    • DB_HOST: The database host.
    • DB_NAME: The database name.
    • DB_USERNAME: The database username.
    • DB_PASSWORD: The database password.
  • The WhatsApp phone application must have:
    • A pinned chat to focus on.
    • No access to your contacts.

Creating the executable:

Execute this command in your terminal: pyinstaller ./src/main.py --name WhatsAppBot --onefile --clean --distpath ./build --specpath ./build --version-file ../version.rc --icon ../icon.ico --key SOME_KEY

You can replace SOME_KEY with the one you prefer.

Objetives:

  • Show an image with the QR code to log in: ✅
  • Handle incoming messages: ✅
  • Create a command handler with:
    • Image handling: ✅
    • Argument handling: ✅
    • Role handling: ✅
  • Save in the DB:
    • Users: ✅
    • Banned Users: ✅
    • Roles: ✅
    • User Roles: ✅
    • Commands: ✅
    • Executed Commands: ✅
  • Available languages:
    • English: ✅
    • French: ✅
    • German: ✅
    • Italian: ✅
    • Portuguese: ✅
    • Spanish: ✅

Global commands:

  • /menu ✅
    • Returns a list of all the available commands.
  • /whoami ✅
    • Tells you who you are.
  • /sticker (with an image)
    • Creates a sticker with an image that you provide.
  • /say <message>
    • Replies with the message you sent..
  • /send <phone number>;<message>
    • Sends a message to a specified phone number, clarifying that it is your message.
  • /random <number | image | quote>
    • Replies with a random number/image/quote.

Staff commands:

  • /resources ✅
    • Returns details about CPU and RAM usage.
    • Requires MODERATOR role or higher.
  • /history <phone number>;<limit?>
    • Returns the command history of an user, with an optional limit.
    • Requires MODERATOR role or higher.
  • /executions <command name>
    • Returns the number of times a command has been executed.
    • Requires MODERATOR role or higher.
  • /user <phone number>
    • Returns information about an user.
    • Requires MODERATOR role or higher.
  • /pfp (with an image)
    • Sets the given image as profile picture.
    • Requires ADMIN role or higher.
  • /status <message>
    • Sets the given message as profile status.
    • Requires ADMIN role or higher.
  • /ban <phone number>;<reason>
    • Bans the given phone number due to a reason.
    • Requires ADMIN role or higher.
  • /unban <phone number>
    • Unbans the given phone number.
    • Requires ADMIN role or higher.
  • /role <phone number>;<role name>
    • Sets a role for a given phone number.
    • Requires OWNER role.

Media

2023-01-21.14-44-11.mp4

Chat Image

whatsapp-bot's People

Contributors

agusjkdev avatar

Stargazers

Ankur Jaiswal avatar Hamad avatar Maksymilian Manowski avatar Muhammad Rivaldi avatar

Watchers

macs avatar  avatar

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.