mukulhase / WebWhatsapp-Wrapper

An API for sending and receiving messages over web.whatsapp [Working as of 18th May 2018]
https://webwhatsapi.readthedocs.io/en/latest/
MIT License
2.02k stars 796 forks source link

send_media.py error #579

Open leoteixeira2016 opened 5 years ago

leoteixeira2016 commented 5 years ago

can someone help me, there are days that I try to send an image the only reference I found was this file but it does not work

lfdelphino commented 5 years ago

Could you show us your error log please?

leoteixeira2016 commented 5 years ago

Olá Luiz Não é feito o envio Estou usando a aplicação em um Linux ubuntu

A mensagem é enviada mas a foto não

Enviado do meu iPhone

Em 14 de mar de 2019, à(s) 21:34, Luiz Delphino notifications@github.com escreveu:

Could you show us your error log please?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

mosaw commented 5 years ago

@lfdelphino I can not check if a number is online can u help ?

leoteixeira2016 commented 5 years ago

@lfdelphino This is the code on the shipping template

from webwhatsapi import WhatsAPIDriver from webwhatsapi.objects.message import Message

driver = WhatsAPIDriver(loadstyles=False) print("Waiting for QR") driver.wait_for_login()

print("Bot started")

try:

phone_safe = "5531########" # Phone number with country code
phone_whatsapp = "{}@c.us".format(phone_safe) # WhatsApp Chat ID
image_path = "image.png" # Local path file
caption = "Testing a sender image" # The caption sent under the image, optional

driver.send_media(image_path, phone_whatsapp, caption) # Expected send_media(self, path, chatid, caption)
print("Media file was successfully sent to {}".format(phone_safe))

except: print("Error while trying to send the midia file.")

but it will not

lfdelphino commented 5 years ago

Does it print Error while trying to send the midia file. ? We must know the error to help.. It works here

marcelocecin commented 5 years ago

driver.send_media("/var/www/whatsapp/file.png", "5531########@c.us", "test")

leoteixeira2016 commented 5 years ago

@marcelocecin It worked?

leoteixeira2016 commented 5 years ago

@lfdelphino Error while trying to send the midia file.

leoteixeira2016 commented 5 years ago

@lfdelphino help please??? Does it print Error while trying to send the midia file. ? yes

lfdelphino commented 5 years ago

@leoteixeira2016 did you specify the right absolute path of the file as the first argument?

Also, did you try sending a different file type (eg. .png, .jpg, .mp3)?

leoteixeira2016 commented 5 years ago

Em 2019-04-01 13:01, Luiz Delphino escreveu:

@leoteixeira2016 [1] did you specify the right absolute path of the file as the first argument?

Also, did you try sending a different file type (eg. .png, .jpg, .mp3)?

-- You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub [2], or mute the thread [3].

I'm trying to send a png the file is in the / var / www / html / img folder

I have this error when I send it

--

Leandro Teixeira Business Intelligence leo@apoioassistencia24horas.com.br www.apoioassistencia24horas.com.br (31)3773-0026

Links:

[1] https://github.com/leoteixeira2016 [2] https://github.com/mukulhase/WebWhatsapp-Wrapper/issues/579#issuecomment-478640296 [3] https://github.com/notifications/unsubscribe-auth/AUOSXZW3yIDvo05RKN-aXew6ZWhQeveUks5vci1vgaJpZM4b06T2

kaykyr commented 5 years ago

@leoteixeira2016 Conseguiu resolver o problema? Did you solve the issue?