- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchatbot.py
More file actions
Latest commit
21 lines (16 loc) · 671 Bytes
/
Copy pathchatbot.py
File metadata and controls
21 lines (16 loc) · 671 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
importpywhatkit
importtime
defsend_whatsapp_message(message, phone_number, hour, minute):
# Menghitung waktu untuk pengiriman pesan
now=time.localtime()
year, month, day=now.tm_year, now.tm_mon, now.tm_mday
send_time= (year, month, day, hour, minute, 0, 0, 0, -1)
# Mengirim pesan WhatsApp ke nomor telepon
pywhatkit.sendwhatmsg(phone_number, message, hour, minute)
# Menunggu pengiriman pesan selesai
whileTrue:
iftime.localtime() >=send_time:
break
time.sleep(1)
# Silahkan ganti nomor wa, pesan, dan waktu sesuai kebutuhan di bawah ini!
send_whatsapp_message("Tes", "+6285646042925", 11, 28)