-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
27 lines (18 loc) · 793 Bytes
/
main.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
import pywhatkit as kit
import pandas as pd
data = pd.read_excel("data.xlsx")
for index, row in data.iterrows():
name = row['NAME']
phone_number = str(int(row['NUMBER'])).strip()
remaining_amount = row['BALANCE']
if not phone_number.startswith("+"):
phone_number = "+" + phone_number
message = (f"Assalam o Alaikum! Sir/Madam {name}, your remaining amount for Greens Avenue monthly fee is {remaining_amount}RS. kindly pay it as soon aas possible.")
hour = 16
minute = (0 + index)
print(f"Sending message to {phone_number}")
try:
kit.sendwhatmsg(phone_number, message, hour, minute)
print(f"Message sent to {name} at {phone_number}")
except Exception as e:
print(f"Failed to send message to {phone_number}: {e}")