반응형

PyWhatKit은 다양한 유용한 기능을 갖춘 Python 라이브러리입니다. 사용하기 쉽고 추가 설정이 필요하지 않습니다. 현재 WhatsApp 및 YouTube 자동화를 위한 가장 인기 있는 라이브러리 중 하나입니다. 새로운 기능과 버그 수정이 포함된 새로운 업데이트가 자주 출시됩니다.

 

PyWhatKit is a Python library with various helpful features. It's easy-to-use and does not require you to do any additional setup. Currently, it is one of the most popular library for WhatsApp and YouTube automation. New updates are released frequently with new features and bug fixes.

 

https://pypi.org/project/pywhatkit/

 

pywhatkit

PyWhatKit is a Simple and Powerful WhatsApp Automation Library with many useful Features

pypi.org

pip3 install pywhatkit

import pywhatkit as kit
import datetime
import time

# Replace these values with your own
phone_number = "+1234567890"  # Include the country code without '+' or '0'
message = "Hello, this is a test message!"

# Set the time to send the message (24-hour format)
hour = 12
minute = 0

# Get the current time
now = datetime.datetime.now()
current_hour = now.hour
current_minute = now.minute

# Calculate the delay in seconds until the specified time
delay_seconds = ((hour - current_hour) * 60 + (minute - current_minute)) * 60

# Wait until the specified time
if delay_seconds > 0:
    print(f"Waiting for {delay_seconds} seconds until {hour}:{minute}")
    time.sleep(delay_seconds)
    

# Send the WhatsApp message
kit.sendwhatmsg(phone_number, message, now.hour, now.minute + 1)  # Adding 1 minute to the current time

print("Message sent successfully!")
반응형

+ Recent posts