Skip to content

Commit 05b30b5

Browse files
Merge pull request Mrinank-Bhowmick#532 from Toheed07/Toheed07
Added a new project Message Spam
2 parents b08496a + 8600051 commit 05b30b5

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

projects/Message-Spam/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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..
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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))
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
random
2+
pyautogui
3+
webbrowser
4+
time

0 commit comments

Comments
 (0)