File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # WhatsApp Random Message Sender
2+
3+ ## Usage
4+
5+ 1 . Install required libraries:
6+
7+ - ` pip install -r requirements.txt `
8+
9+ 2 . Run the script:
10+ ```
11+ python mesaage_spam.py
12+ ```
13+
14+ 3. Follow on-screen instructions to log in to WhatsApp Web.
15+
16+ 4. The script will send random messages to the current chat.
17+
18+ ## Customization
19+
20+ - Edit the `messages` variable to change the list of messages to send.
21+ - Adjust the sleep interval for message timing..
Original file line number Diff line number Diff line change 1+ # Import necessary libraries
2+ import random
3+ import pyautogui as pg
4+ import webbrowser as wb
5+ import time
6+
7+ # Define the WhatsApp Web URL
8+ web_url = "https://web.whatsapp.com"
9+
10+ # Open the web browser to the WhatsApp Web URL
11+ wb .open (web_url )
12+
13+ # Wait for 10 seconds to allow the user to log in by scanning the QR code
14+ time .sleep (10 )
15+
16+ # List of messages to send
17+ messages = ('Hello' , 'Hey' , 'Good Morning' )
18+
19+ # Send 10 random messages
20+ for _ in range (10 ):
21+ # Choose a random message from the list
22+ message = random .choice (messages )
23+
24+ # Type and send the message using PyAutoGUI
25+ pg .write (message )
26+ pg .press ('enter' )
27+
28+ # Pause for a random duration between 1 to 3 seconds
29+ time .sleep (random .uniform (1 , 3 ))
Original file line number Diff line number Diff line change 1+ random
2+ pyautogui
3+ webbrowser
4+ time
You can’t perform that action at this time.
0 commit comments