WhatsApp.messages.text()
Send a WhatsApp text message.
Example:
Send a text message to the phone number 12345678901
.
import WhatsApp from 'whatsapp';
const senderNumber = 12345678901234567890;
const wa = new WhatsApp( senderNumber );
const message =
{
"body": "MESSAGE_CONTENT",
"preview_url": false
};
wa.messages.text( message, 12345678901 );
Arguments
body
: TextObject — the object describing the text to send.recipient
: number — the recipient's phone number with country code.replyMessageId
: string (optional) — the received WhatsApp message Id to reply back to.
Returns
Promise — Server response object on success.