pranavms13 / whatsapp-node-api

A Simple NodeJS API Wrapper for WhatsApp
Other
474 stars 183 forks source link

Image not sent #6

Closed thiagootero closed 4 years ago

thiagootero commented 4 years ago

Hello friends. Until yesterday I was able to send an image using the code:

const media = MessageMedia.fromFilePath(path.resolve('cardapio1.jpeg')); client.sendMessage(msg.from, media, { caption: '' || "" });

Today it does not send anymore and does not give any error on the console, it simply does not send and does not point out errors. What can it be? There is no mistake in the path or in the name of the image, I didn't change anything from yesterday, it just stopped.

pranavms13 commented 4 years ago

I do not know why you are using '' || "" as caption. Try :

const media = MessageMedia.fromFilePath(path.resolve('cardapio1.jpeg'));
client.sendMessage(msg.from, media, { caption: "" });

If it still doesn't work, please run npm update to update the whatsapp-web.js dependency and retry.

pranavms13 commented 4 years ago

Also, look into the following link for more info. https://waguide.pedroslopez.me/features/handling-attachments#sending-local-files

thiagootero commented 4 years ago

Really, it worked! Thank you so much again!

Do you think there is any chance of a version that we can use the API simultaneously with WhatsappWeb?

Em qua., 26 de ago. de 2020 às 16:27, Pranav M S notifications@github.com escreveu:

Look into the following link for more info.

https://waguide.pedroslopez.me/features/handling-attachments#sending-local-files

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/pranavms13/whatsapp-node-api/issues/6#issuecomment-681078295, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDSJ3GKITC5OCHNEQT63CTSCVO3HANCNFSM4QLG2VZA .

pranavms13 commented 4 years ago

Currently, there's no support for running more than one instance of WhatsApp Web. This may be possible when WhatsApp releases multi-device login.