Ankit404butfound / PyWhatKit

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

Receiver determination does not work properly and copyq not found #152

Open albinisma96 opened 2 years ago

albinisma96 commented 2 years ago

Hello. I have tested the library and it works perfectly in window. In ubuntu it works well what is the sending of text messages with the function "pywhatkit.sendwhatmsg_instantly", but the problem happens when I try to use "sendwhats_image", what the terminal tells me is the following

sh: 1: copyq: not found

And I have not been able to find what the problem is. Both ubuntus mentioned in the title are running on Box virtual machine. In both I have the version of xclip 0.12

Can you help me please

aaryanrr commented 2 years ago

Hey @albinisma96, thanks for reaching out. We have shifted from xclip to copyq and the documentation has been updated accordingly. You need to start the copyq server using the copyq command in a separate terminal window. Follow the installation instructions here.

albinisma96 commented 2 years ago

Sure enough, that solved the problem. Now the only thing that appears to me is the fact that the image is loaded, but it is not sent (As the program does not give enter)

ns23k commented 2 years ago

@albinisma96 this is a common problem,in pywhatkit/core/core.py file on line 120 increase the wait-time to 9 or more time.sleep(9)

00war10ck00 commented 2 years ago

@Naman23-coder I changed time.sleep to 10 in core.py but still not sending

aaryanrr commented 2 years ago

Can you share the screenshot of the code you have changed.

00war10ck00 commented 2 years ago

Can you share the screenshot of the code you have changed.

image

albinisma96 commented 2 years ago

Hello. I was able to make the image be sent automatically by adding this portion of the code (in green) to the file whats.py.

image

00war10ck00 commented 2 years ago

image

While sending image to group with pywhatkit.sendwhats_image("AB123CDEFGHijklmn", "Images/Hello.png", "Hello")

aaryanrr commented 2 years ago

image

While sending image to group with pywhatkit.sendwhats_image("AB123CDEFGHijklmn", "Images/Hello.png", "Hello")

This looks like a bug in the way we check whether the country code is present or not. For now you can comment out this line in the sendhwhats_image function Screenshot from 2021-11-26 11-15-53

s33k3rs commented 2 years ago

You need to start the copyq server using the copyq command in a separate terminal window

How to do this?

aaryanrr commented 2 years ago

Hey @s33k3rs, Open up a separate terminal Window and type copyq and press enter. This will start the copyq server. Do not close that terminal window while you are using copyq.

s33k3rs commented 2 years ago

Hey @s33k3rs, Open up a separate terminal Window and type copyq and press enter. This will start the copyq server. Do not close that terminal window while you are using copyq.

thanks for the instructions, send pictures works fine now

samadpls commented 2 years ago

Hello. I have tested the library and it works perfectly in window. In ubuntu it works well what is the sending of text messages with the function "pywhatkit.sendwhatmsg_instantly", but the problem happens when I try to use "sendwhats_image", what the terminal tells me is the following

sh: 1: copyq: not found

And I have not been able to find what the problem is. Both ubuntus mentioned in the title are running on Box virtual machine. In both I have the version of xclip 0.12

Can you help me please

can you guide me on how you are sending images through Windows? I tried, but it just opened the Whatsapp screen and I have to manually press cntl+v and then enter to send an image. my code pywhatkit.sendwhats_image(number, imageslip, now.hour, now.minute, True, 2)

ns23k commented 2 years ago

@asamadsid try:

pywhatkit.sendwhats_image(number, imageslip, now.hour, now.minute, True, wait_time=15)
samadpls commented 2 years ago

@asamadsid try:

pywhatkit.sendwhats_image(number, imageslip, now.hour, now.minute, True, wait_time=15)

getting this TypeError: sendwhats_image() got multiple values for argument 'wait_time'

ns23k commented 2 years ago
pywhatkit.sendwhats_image(number, imageslip, now.hour, now.minute, wait_time=15, True)