Ankit404butfound / PyWhatKit

Send WhatsApp message at certain time and many other things.
MIT License
1.37k stars 297 forks source link

When trying to send an image with text, it clicks "enter" on the text and does not send the message. #335

Closed Claudio-aps closed 5 months ago

Claudio-aps commented 5 months ago

Description

Normally I use pywhatkit to automate sending via WhatsApp, but today it stopped working for me since the image is not being sent when I add text. Instead of sending the image, it is doing an enter on the associated text and the message is not sent.

To Reproduce

when i use pywhatkit.sendwhats_image(phone_number, screenshot_path, "TEST", 10, True) I am able to view the image, but when the sending process is carried out I see that an "enter" is performed on the text and the image cannot be sent.

Screenshots

If applicable, add Screenshots to help explain your Problem

Version Information

Esculture commented 5 months ago

Hi, I'm facing the same issue right after Windows 11 was updated WhatsApp msg not able to send automatically. Hope someone can help. Thanks

Claudio-aps commented 5 months ago

Esculture

I have managed to implement a temporary solution, which consists of adding another click before pressing "enter". Try to enter the core.py file inside the pywhatkit folder. You must modify the "send_image" function, adding a click before the final "enter".

time.sleep(1)
click(WIDTH / 2, HEIGHT / 2)
time.sleep(1)
press("enter")