The chat id
Why the chat is being created. Only relevant when the chat
does not exist yet and needs to be created. Use
'username_contactless_search' for contacts resolved from a @username:
it is the only origin that makes WhatsApp share your own phone number with
the contact when your account has no username, matching the native flow.
const chat = await WPP.chat.find('[number]@c.us');
// For a contact resolved from a @username lookup, pass the matching origin
// so WhatsApp applies the same LID metadata it applies natively
const { wid } = await WPP.contact.queryUsernameExists('someusername');
const chat = await WPP.chat.find(wid, 'username_contactless_search');
Find a chat by id
This create a new chat if no one was found