{"id":13827630,"url":"https://github.com/NaskIII/Py-WhatsApp-Bot","last_synced_at":"2025-07-09T04:32:55.125Z","repository":{"id":136750106,"uuid":"445723581","full_name":"NaskIII/Py-WhatsApp-Bot","owner":"NaskIII","description":"Py-WhatsApp-Bot is a library that allows you to automatically control various WhatsApp Web functions. In addition, the library allows you to receive messages and even images, without any manual interaction.","archived":false,"fork":false,"pushed_at":"2022-02-01T03:53:46.000Z","size":41027,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-05T09:16:23.327Z","etag":null,"topics":["automation","py-whatsapp-bot","python3","whatsapp-web"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NaskIII.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-01-08T04:30:16.000Z","updated_at":"2022-04-14T21:51:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"b53393e6-d32e-4150-83f1-1903191d0ced","html_url":"https://github.com/NaskIII/Py-WhatsApp-Bot","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaskIII%2FPy-WhatsApp-Bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaskIII%2FPy-WhatsApp-Bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaskIII%2FPy-WhatsApp-Bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NaskIII%2FPy-WhatsApp-Bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NaskIII","download_url":"https://codeload.github.com/NaskIII/Py-WhatsApp-Bot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225486377,"owners_count":17481885,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","py-whatsapp-bot","python3","whatsapp-web"],"created_at":"2024-08-04T09:02:03.826Z","updated_at":"2024-11-20T07:30:50.718Z","avatar_url":"https://github.com/NaskIII.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Py-WhatsApp-Bot\nPy-WhatsApp-Bot is a library that allows you to automatically control various WhatsApp Web functions. In addition, the library allows you to receive messages and even images, without any manual interaction.\n\n## Links\nDocumentation - **Coming Soon**\n\n## Installation\nPy-WhatsApp-Bot is not yet available on PyPi.\n\nPy-WhatsApp-Bot officially supports python 3.10+.\n\n### Cloning the Repository\nAt the moment the installation is only available through github.\n#### HTTPS\n`git clone https://github.com/NaskIII/Py-WhatsApp-Bot.git`\n\n## Features\n- Send messages\n- Receive messages\n- Send Images\n- Receive images\n- Switch chat when another conversation executes a command\n- And more is in development\n\n## Usage\n``` python\nfrom core import Whatsapp\nimport os\n\n# Start Whatsapp Bot class\nwhatsapp = Whatsapp.Whatsapp_API()\n\n# Open whatsapp web, if the login has never been done, by default you will have 120 seconds to do so\nwhatsapp.open_whatsapp_web()\n\n# Search for a contact in your contact list and start a conversation\nwhatsapp.search_contact('Matheus Morillo')\n\n# Write a message in whatsapp web text box\nwhatsapp.write_message('Hi Matheus, how are you?')\n\n# Click on the button to send the previously written message\nwhatsapp.click_send_message_button()\n\nquit: bool = True\n\nwhile quit:\n    # Read incoming messages that contain the activation message at the beginning of the sentence.\n    message_from_matheus: str = whatsapp.read_message(trigger_message='!')\n\n    if message_from_matheus == '!ping':\n        # Write and send a message to the current conversation\n        whatsapp.write_and_send_message('pong')\n    elif message_from_matheus.__contains__('!image'):\n        # Reads an image to the current conversation, receives the activation command and the directory where the image is located\n        if whatsapp.read_image(message_from_matheus, os.getcwd() + r'/images'):\n            # If the image is successfully received, a confirmation message is sent.\n            whatsapp.write_and_send_message(\"Command executed successfully\")\n        else:\n            # If an error occurs, an error message is sent.\n            whatsapp.write_and_send_message(\n                \"There was an unexpected error, please try again later.\")\n    elif message_from_matheus.__contains__('!sendimage'):\n        # Send an image to the current conversation, receive the path to the image as a parameter\n        if whatsapp.send_image(message_from_matheus):\n            # If the image is successfully sent, a confirmation message is sent.\n            whatsapp.write_and_send_message(\n                \"Command executed successfully\")\n        else:\n            # If an error occurs, an error message is sent.\n            whatsapp.write_and_send_message(\n                \"There was an unexpected error, please try again later.\")\n    elif message_from_matheus == '!quit':\n        whatsapp.write_and_send_message('Goodbye!')\n        # Close the process\n        whatsapp.quit()\n\n\n```\nFor more examples visit our Wiki\n\n## License\nMIT. For more information please [visit](https://github.com/NaskIII/Py-WhatsApp-Bot/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNaskIII%2FPy-WhatsApp-Bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FNaskIII%2FPy-WhatsApp-Bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FNaskIII%2FPy-WhatsApp-Bot/lists"}