open-wa / wa-automate-python

💬 🤖 The most advanced Python whatsapp library for chatbots with advanced features. Be sure to ⭐ this repository for updates!
Other
330 stars 71 forks source link

Sending Media is not working #49

Closed GauthamramRavichandran closed 3 years ago

GauthamramRavichandran commented 3 years ago

Operating System : Ubuntu 18.04.4 LTS Python : Python 3.6.9 Installation : via pip

dver = WhatsAPIDriver(headless = True)
dver.set_local_storage(loads(payload))
dver.driver.refresh()
sleep(20)
if dver.is_logged_in():
    for grp in dver.get_all_groups():
        print(grp.id, grp.name)
        dver.chat_send_message(chat_id = grp.id, message = "Hi! Test #3")
        grp.send_media(image_path = '/home/xxxxxx/some_image.png', caption = "Test 3")
else:
    print("Not logged In")

The send_message is working, was able to send the text message in the groups. But send_media is not working, it's throwing any error/ anything in logs as well.

Output: Shows the grp.id grp.name of all groups and sends text message alone

GauthamramRavichandran commented 3 years ago

I have tried the following,

marcelocecin commented 3 years ago

use https://github.com/mukulhase/WebWhatsapp-Wrapper

GauthamramRavichandran commented 3 years ago

This repo is discontinued, then? I'll use that pip package.

mrodal commented 3 years ago

Its weird, I just tried and it is working correctly doing group.send_media(IMAGE_PATH, 'test') sending a png or jpg. What does grp.send_media return for you? This repo is not discontinued

mrodal commented 3 years ago

I just fixed an issue, can you try with the latest version? 1.3.10

GauthamramRavichandran commented 3 years ago

Great!, It's fixed now, why was it not working earlier? I had not received any errors as well in the python script, it seems there's a catch section in the js but could it be re-raised to python, for handling at python side