-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.py
29 lines (21 loc) · 832 Bytes
/
script.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import pywhatkit as kit
import time
# List of phone numbers
contacts = [
# type contact numbers followed by comma (,)
]
# Message to send
message = "🎉 Happy New Year! 🎊 May this year bring you happiness, success, and good health. 🥳"
# Schedule and send messages
for number in contacts:
try:
# Schedule the message for 1 minute from now
current_time = time.localtime()
hour = current_time.tm_hour
minute = current_time.tm_min + 1
# Send message using pywhatkit
kit.sendwhatmsg(number, message, hour, minute)
print(f"Message sent to {number}")
time.sleep(60) # Wait to ensure the message is sent before sending the next one
except Exception as e:
print(f"Failed to send message to {number}. Error: {e}")