whatsapp-web.js icon indicating copy to clipboard operation
whatsapp-web.js copied to clipboard

How do I send a message to a phone number instead of an JID ?

Open gpyun opened this issue 2 years ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Is your feature request related to a problem? Please describe.

How do I send a message to a phone number instead of an JID ? Or how does a mobile phone number turn into a JID ?

Describe the solution you'd like.

https://wa.me/1XXXXXXXXXX

https://faq.whatsapp.com/5913398998672934/?helpref=hc_fnav

Describe an alternate solution.

No response

Additional context

No response

gpyun avatar Feb 08 '23 10:02 gpyun

there is a function that you pass the number and return the Jid, aissm you can send a message through the number

const id = await client.getNumberId(number); await client.sendMessage(id._serialized,message);

iannortnau avatar Feb 10 '23 16:02 iannortnau