Skip to main content

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:

Python 3

INSTALLATION:

pip install PyWaMG

FUNCTIONS:

  1. wa_login()

    Use to login to Whatsapp Web

  2. 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)

  3. send_txt(number,message,wait,times,appendMessageNumber = False,isInContacts = True,showLogs = True)

    Sends a text message to a WhatsApp number

    1. number : str

      • WhatsApp number where the message will be sent
    2. message : str

      • Message content that will be sent
    3. wait : int

      • Time in seconds to wait between sending messages
    4. times : int

      • Number of times to send the message
    5. appendMessageNumber : bool, optional

      • Add message count + 1 before message content (default is False)
    6. isInContacts : bool, optional

      • Set to false if sending message to a new number (default is True)
    7. showLogs : bool, optional

      • Show logs, ie record of messages sent (default is True)
  4. send_txt_to_group(group_id,message,wait,times,appendMessageNumber=False,showLogs=True)

    Sends a text message to a WhatsApp group

    1. group_id : str

      • WhatsApp Group ID (as seen in Group Invite Link)
    2. message : str

      • Message content that will be sent
    3. wait : int

      • Time in seconds to wait between sending messages
    4. times : int

      • Number of times to send the message
    5. appendMessageNumber : bool, optional

      • Add message count + 1 before message content (default is False)
    6. showLogs : bool, optional

      • Show logs, ie record of messages sent (default is True)
  5. send_file(number,fpath,isInContacts=True,showLogs=True)

    Sends a file/document to a WhatsApp number

    1. number : str

      • WhatsApp number where the file will be sent
    2. fpath : str

      • Absolute path to the file being sent
    3. isInContacts : bool, optional

      • Set to false if sending message to a new number (default is True)
    4. showLogs : bool, optional

      • Show logs, ie record of messages sent (default is True)
  6. send_file_to_group(group_id,fpath,showLogs=True)

    Sends a file/document to a WhatsApp number

    1. group_id : str

      • WhatsApp Group ID (as seen in Group Invite Link)
    2. fpath : str

      • Absolute path to the file being sent
    3. showLogs : bool, optional

      • Show logs, ie record of messages sent (default is True)
  7. 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

    1. number : str

      • WhatsApp number where the file will be sent
    2. fpath : str

      • Absolute path to the file being sent
    3. caption : str

      • Message content that will be sent with the media file
    4. isInContacts : bool, optional

      • Set to false if sending message to a new number (default is True)
    5. showLogs : bool, optional

      • Show logs, ie record of messages sent (default is True)
  8. send_media_file_to_group(group_id,fpath,caption,showLogs=True)

    Sends a file/document to a WhatsApp number

    1. group_id : str

      • WhatsApp Group ID (as seen in Group Invite Link)
    2. fpath : str

      • Absolute path to the file being sent
    3. caption : str

      • Message content that will be sent with the media file
    4. 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:

  1. Open the Group chat in WhatsApp
  2. Click on the Group name at the top
  3. Click on 'Invite to group via link' (Ask your group admin to send the invite link if you can't see it)
  4. Get the Group ID (https://chat.whatsapp.com/this_is_the_group_id)



License: MIT
Made with :heart: by Meghraj Goswami
For Terms of Service visit https://bit.ly/3aeIVfl

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyWaMG-1.0.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

PyWaMG-1.0.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file PyWaMG-1.0.2.tar.gz.

File metadata

  • Download URL: PyWaMG-1.0.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0

File hashes

Hashes for PyWaMG-1.0.2.tar.gz
Algorithm Hash digest
SHA256 e06e0e91b9c3bdaa1864b6903f3b5274daad03cf27c4aa45b9e6826a8867f78b
MD5 5af7b429a1f94698a0e539153016bedb
BLAKE2b-256 5ff6a7d147eec293c3191faa2f9807d8e6a87b9ae113a78bf202fa13d9ac6edd

See more details on using hashes here.

File details

Details for the file PyWaMG-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: PyWaMG-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.0 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0

File hashes

Hashes for PyWaMG-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 93cd0d9502a6fda3852056d73be34b5be17c16260a687c40fd6ed9944d89d640
MD5 a1753d9498ac8ddc448e6bdc1b238b24
BLAKE2b-256 378ddcfb2eeeebfa253e03fe9dc199939a035507944c283a8374c0744e8b4c00

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page