Skip to content

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

Notifications You must be signed in to change notification settings

kyhftaeonn/WhatsApp-Bot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WhatsApp Bot

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

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 94.6%
  • PLpgSQL 5.3%
  • Shell 0.1%