Whatsapp-web.js: Sending text with link and standard embedded image

Created on 7 Mar 2020  路  6Comments  路  Source: pedroslopez/whatsapp-web.js

When we send a message with a link, if we wait for a while (Image 1) whatsapp will add the default image of the link to the message.
However, when the message is written and sent quickly, the default image of the link is not loaded.
How can we wait for the default image of the link to load?
Thanks!

https://prnt.sc/rcxcc3
https://prnt.sc/rcxcie
https://prnt.sc/rcxcvb

enhancement

Most helpful comment

@pedroslopez ,
Is it possible to create a short interval between writing the message and clicking on the send?
3 seconds...
I believe that this would solve this situation.

All 6 comments

Any update on this?

@pedroslopez ,
Is it possible to create a short interval between writing the message and clicking on the send?
3 seconds...
I believe that this would solve this situation.

Yeah in case the sendmesage content has a link in the body (detection using regex) we could conditionally add a timeout

To be honest, I don't think a timeout would work since we're not writing the message in the textbox. We're directly calling internal methods that send the message.

I haven't had time to look into this, but will do so soon.

Ok. I understand

This has been included as the default behavior in 1.5.0. Thanks for the suggestion :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

andersondeoliveiramachado picture andersondeoliveiramachado  路  7Comments

iamshouvikmitra picture iamshouvikmitra  路  4Comments

ngekoding picture ngekoding  路  5Comments

marcopandolfo picture marcopandolfo  路  5Comments

franciscol99 picture franciscol99  路  3Comments