PyWaMG - WhatsApp Automator Bot
Project description
PyWaMG - WhatsApp Automator Bot
PyWaMG is a simple python library to automate sending messages and files on WhatsApp
About Project
PyWaMG can be used to send documents, media or text messages through your personal WhatsApp number to groups and individual people, once or many times at defined intervals.
You just have to login to WhatsApp web once on your personal computer, then you can upload the bot to remote servers so the messages keep getting sent without any user interaction.
REQUIREMENTS:
INSTALLATION:
pip install PyWaMG
FUNCTIONS:
-
wa_login(isHeadless=True)
Use to login to Whatsapp Web If parameter isHeadless is set to False it will show the WhatsApp web window as well
isHeadless : bool, optional Headless mode (default is True)
-
wa_close(isLogout=False)
Closes Whatsapp Web If parameter isLogout is set to True it logs out of Whatsapp Web
isLogout : bool, optional Log out of Whatsapp Web (default is False)
-
send_txt(number,message,wait,times,appendMessageNumber = False,isInContacts = True,showLogs = True)
Sends a text message to a WhatsApp number
-
number : str
- WhatsApp number where the message will be sent
-
message : str
- Message content that will be sent
-
wait : int
- Time in seconds to wait between sending messages
-
times : int
- Number of times to send the message
-
appendMessageNumber : bool, optional
- Add message count + 1 before message content (default is False)
-
isInContacts : bool, optional
- Set to false if sending message to a new number (default is True)
-
showLogs : bool, optional
- Show logs, ie record of messages sent (default is True)
-
-
send_txt_to_group(group_id,message,wait,times,appendMessageNumber=False,showLogs=True)
Sends a text message to a WhatsApp group
-
group_id : str
- WhatsApp Group ID (as seen in Group Invite Link)
-
message : str
- Message content that will be sent
-
wait : int
- Time in seconds to wait between sending messages
-
times : int
- Number of times to send the message
-
appendMessageNumber : bool, optional
- Add message count + 1 before message content (default is False)
-
showLogs : bool, optional
- Show logs, ie record of messages sent (default is True)
-
-
send_file(number,fpath,isInContacts=True,showLogs=True)
Sends a file/document to a WhatsApp number
-
number : str
- WhatsApp number where the file will be sent
-
fpath : str
- Absolute path to the file being sent
-
isInContacts : bool, optional
- Set to false if sending message to a new number (default is True)
-
showLogs : bool, optional
- Show logs, ie record of messages sent (default is True)
-
-
send_file_to_group(group_id,fpath,showLogs=True)
Sends a file/document to a WhatsApp number
-
group_id : str
- WhatsApp Group ID (as seen in Group Invite Link)
-
fpath : str
- Absolute path to the file being sent
-
showLogs : bool, optional
- Show logs, ie record of messages sent (default is True)
-
-
send_media_file(number,fpath,caption,isInContacts=True,showLogs=True)
Sends a visual media file (image/video) with an optional caption message to a WhatsApp number
-
number : str
- WhatsApp number where the file will be sent
-
fpath : str
- Absolute path to the file being sent
-
caption : str
- Message content that will be sent with the media file
-
isInContacts : bool, optional
- Set to false if sending message to a new number (default is True)
-
showLogs : bool, optional
- Show logs, ie record of messages sent (default is True)
-
-
send_media_file_to_group(group_id,fpath,caption,showLogs=True)
Sends a file/document to a WhatsApp number
-
group_id : str
- WhatsApp Group ID (as seen in Group Invite Link)
-
fpath : str
- Absolute path to the file being sent
-
caption : str
- Message content that will be sent with the media file
-
showLogs : bool, optional
- Show logs, ie record of messages sent (default is True)
-
NOTE:
Phone number has to be in the format 'Country code'+'phone number', eg for country code +91 and mobile number 9876543210, the number parameter should be '919876543210'
Group ID can be found out from the group invite link. For that:
- Open the Group chat in WhatsApp
- Click on the Group name at the top
- Click on 'Invite to group via link' (Ask your group admin to send the invite link if you can't see it)
- Get the Group ID (https://chat.whatsapp.com/this_is_the_group_id)
Made with :heart: by Meghraj Goswami
For Terms of Service visit https://bit.ly/3aeIVfl
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file PyWaMG-1.1.3.tar.gz
.
File metadata
- Download URL: PyWaMG-1.1.3.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2578b6abf777cf8875cfeb9614c938987d2c3809c1247e8285380c1974ce8e7 |
|
MD5 | ce18c48ed07961660addfaed13627efd |
|
BLAKE2b-256 | 5518cf4f0d1d270cb21dbd575c3877024d109e29fb41ebdbf01a740a9f10eeb4 |
File details
Details for the file PyWaMG-1.1.3-py3-none-any.whl
.
File metadata
- Download URL: PyWaMG-1.1.3-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b0f27499c9d77ef4c6607ca5ee06a2999765aff241ff1fb0cd27ec7adfb99060 |
|
MD5 | 8d6f26bb760c6541b291ec8ae3686b54 |
|
BLAKE2b-256 | 4470a9cad6df526e15de3b32ad87eac72acb98671f242a5eb48bcffcbdb74940 |