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.
- 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.
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.
- 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: ✅
- /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.
- /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.