Sych is a python library for automating WhatsApp web.
note: this codebase is outdated as of 2020 last actual commit may 15, 2018
This implementation does not involve direct calls to WhatsApp servers, making it safer to use than those that do.
The following examples call the library core directly, see cb01.py for a chat-bot example.
Sending a message with an emoji:
from whatsapp import WhatsApp
whatsapp = WhatsApp(10)
whatsapp.send_message("Recipient", ":heart: Good!")
Getting a contact's status message
from whatsapp import WhatsApp
whatsapp = WhatsApp(10)
print(whatsapp.get_status("Name"))
Getting a contact's last seen datetime
from whatsapp import WhatsApp
whatsapp = WhatsApp(10)
print(whatsapp.get_last_seen("Name"))
Getting the number of members in a group:
from whatsapp import WhatsApp
whatsapp = WhatsApp(10)
result = whatsapp.participants_for_group("group")
- Clone
git clone https://github.com/CNajm/Sych-WhatsApp.git
- Navigate to
cd Sych-WhatsApp
- Install dependencies
pip install -r requirements.txt
- Download the chrome webdriver
- Extract the chromedriver to
Sych-WhatsApp/Sych
You can now use the library core as shown in the above screenshots.
To run the bot framework:
- Perform above steps
- Edit
cb01.py
: Change the value ofgroup
to whatever contact/group you wish to listen on. - Run
python3 cb01.py
Branch your changes and pull request. (Step by step guide if this is new to you)
Do submit bugs and suggestions to the Issues tab, 1 issue = 1 cookie.