raweee / node-red-contrib-whatsapp-link

Simple Node-Red node to link Whatsapp
https://discord.gg/VApVeGuF
28 stars 7 forks source link

Whatsapp Lite: Sending image #36

Closed jesusmarcos closed 12 months ago

jesusmarcos commented 1 year ago

Hi. Good morning.

Maybe I'm doing something wrong, but as far as I understand, the option to send an image differs from sending a text message, that I need a msg.image attribute with a BASE-64 image encoded. Then, msg.payload should contain the caption and msg.toNumber the ID of the receiver.

It works great to send text messages, but not an image (just displays te caption as if I'm sending a text message). The image is generated from Stable Diffusion and it's a correct PNG's BASE64 encoding.

Am I doing something wrong?

Thanks in advance for your answer and congratulations for this really useful contribution.

jesusmarcos commented 1 year ago

Adding additional information (just in case it's useful).

I was finally able to find the chats-out.js and take a look how it works. It's using the option to define templateButtons. In this case, the image (I'm now using just the URL) is not shown because when the "Text" option exists, it ignores the image.

If I change "text" by "caption", then the image appears but the I receive the event in the chats-in node but in a very strange behavior so I don't have any control of the "msg" object. So all the nodes behind the chats-in are executed but there is no object to get the information (I can see it because I have debug nodes).

I also tried the other options provided by adiwajshing/baileys repository but same strange behavior.

I don't really see how to solve it. Are you able to send images without any issue with the WhatsApp Lite version?