@wppconnect-team/wppconnect - v2.4.7-rc.0
    Preparing search index...

    The Node.js SDK re-exports the WAJS namespace for TypeScript. This reference describes types from WA-JS 4.8.5-rc.0. For operations available on a connected Node.js client, see Whatsapp. For functions running inside WhatsApp Web, see the WA-JS browser API.

    Function find

    • Find a chat by id

      This create a new chat if no one was found

      Parameters

      • chatId: string | WAJS.whatsapp.Wid

        The chat id

      • OptionaloriginType: ChatOriginType

        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.

      Returns Promise<ChatModel>

      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');