OptionalcaptionOptionalcreateCreate a new chat to a new contact
OptionaldelayDelay some time (in ms) before sending message While delaying, Typing Status is used to look like a human interaction
OptionaldetectAutomatic detect and add the mentioned contacts with @[number]
OptionalfilenameOptionalfooterOptionalisOptionalisOptionalmarkAutomatically mark chat is read after send a message
OptionalmentionedDefine a mentioned list for a message This option work better with a message with mension
OptionalmessageOptionalmimetypeOptionalquotedQuote a message, like a reply message
OptionalquotedQuote a message using a previously saved payload. The payload must be the JSON string representation of a raw message. Raw messages can be obtained when using getMessageById or getMessages When provided it has priority over quotedMsg.
OptionalwaitWait for send while the ACK of message is SENT(1)
OptionalwaveformSend an audio message as a PTT with waveform
// Enable waveform
WPP.chat.sendFileMessage(
'[number]@c.us',
'data:audio/mp3;base64,<a long base64 file...>',
{
type: 'audio',
isPtt: true,
waveform: true // false to disable
}
);
// Disable waveform
WPP.chat.sendFileMessage(
'[number]@c.us',
'data:audio/mp3;base64,<a long base64 file...>',
{
type: 'audio',
isPtt: true,
waveform: false
}
);
Send an audio message as a PTT, like a recorded message
Example