### Install Dependencies and Build Project Source: https://wppconnect.io/wa-js/index.html These commands are used to install project dependencies and build the JavaScript files for production or development environments. ```bash npm install ``` ```bash npm run build:prd # or build:dev for development ``` -------------------------------- ### startWebComms Source: https://wppconnect.io/wa-js/modules/whatsapp.websocket.html Starts the WebSocket communication channels. ```APIDOC ## Function: startWebComms ### Description Starts the WebSocket communication channels. ### Parameters None ### Returns - Promise ``` -------------------------------- ### Get all connection keys Source: https://wppconnect.io/wa-js/index.html To get the most up-to-date list of available functions for connection management, run this in your browser console. ```javascript Object.keys(WPP.conn).sort() ``` -------------------------------- ### listenTo Source: https://wppconnect.io/wa-js/classes/whatsapp.QuickReplyCollection.html Starts listening to events on a given context. ```APIDOC ## listenTo ### Description Starts listening to events on a given context. ### Parameters * context: any * eventName: Event * `Optional`listener: Listener ### Returns this ``` -------------------------------- ### Get Connected Device Platform Source: https://wppconnect.io/wa-js/functions/conn.getPlatform.html Call this function to check if the connected device is Android, iPhone, or Windows Phone. No setup is required. ```javascript const getPlatform = WPP.conn.getPlatform(); ``` -------------------------------- ### startDownloading Source: https://wppconnect.io/wa-js/functions/whatsapp.Browser.startDownloading.html Initiates a download. This function does not take any arguments and returns void. ```APIDOC ## startDownloading() ### Description Initiates a download process. ### Method `startDownloading()` ### Parameters This function does not accept any parameters. ### Returns `void` ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.QuickReplyCollection.html Retrieves a QuickReplyModel from the collection by its identifier. ```APIDOC ## get ### Description Retrieves a QuickReplyModel from the collection by its identifier. ### Parameters * e: Stringable ### Returns QuickReplyModel | undefined ``` -------------------------------- ### Get Current Profile Name Source: https://wppconnect.io/wa-js/functions/profile.getMyProfileName.html Call this function to retrieve your current profile name. No specific setup or imports are required beyond the WPP object. ```javascript const myProfileName = WPP.profile.getMyProfileName(); ``` -------------------------------- ### conn.main_init Source: https://wppconnect.io/wa-js/interfaces/ev.ConnEventTypes.html Triggered when the interface is booting up. ```APIDOC ## conn.main_init ### Description Triggered when the interface is booting up. ### Event Name `conn.main_init` ### Example ```javascript WPP.on('conn.main_init', () => { // Your code }); ``` ``` -------------------------------- ### Get My Profile Picture Source: https://wppconnect.io/wa-js/functions/profile.getMyProfilePicture.html Call this function to retrieve the thumbnail model of your current profile picture. No specific setup is required beyond having the WPP object initialized. ```javascript await WPP.profile.getMyProfilePicture(); ``` -------------------------------- ### constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.QuickReplyCollection.html Initializes a new instance of the QuickReplyCollection class. ```APIDOC ## constructor * new QuickReplyCollection(e?: any, t?: { parent: any }): QuickReplyCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns QuickReplyCollection ``` -------------------------------- ### Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.Wid.html Initializes a new Wid instance. It takes a string ID and an optional options object. ```APIDOC ## constructor * new Wid( id: string, options?: { intentionallyUsePrivateConstructor: boolean }, ): Wid #### Parameters * id: string * `Optional`options: { intentionallyUsePrivateConstructor: boolean } #### Returns Wid ``` -------------------------------- ### Check if Main Interface is Initializing Source: https://wppconnect.io/wa-js/functions/conn.isMainInit.html Call this function to get a boolean indicating whether the main interface is initializing. No specific setup or imports are required beyond having the WPP object available. ```javascript const isMainInit = WPP.conn.isMainInit(); ``` -------------------------------- ### launch Source: https://wppconnect.io/wa-js/classes/whatsapp.SocketModel.html Launches or starts a process related to the socket connection. ```APIDOC ## launch ### Description Launches or starts a process. ### Method `launch(e?: any, t?: number): any` ### Parameters * **e** (any) - Optional. Data or event object. * **t** (number) - Optional. A numerical parameter. ### Returns any ``` -------------------------------- ### onStartingLogout Source: https://wppconnect.io/wa-js/classes/whatsapp.CmdClass.html Callback for when the logout process is starting. ```APIDOC ## onStartingLogout ### Description Callback for when the logout process is starting. ### Method ``` onStartingLogout(): void ``` ``` -------------------------------- ### Get Messages from IndexedDB by Row ID Source: https://wppconnect.io/wa-js/functions/indexdb.getMessagesFromRowId.html Retrieve messages from IndexedDB 'model-storage' starting from a specific rowId. Use the 'limit' option to control the number of messages fetched. A limit of -1 fetches all available messages, but should be used with caution. ```javascript const messages = await WPP.indexdb.getMessagesFromRowId({ minRowId: 999960610 }); ``` ```javascript const messages = await WPP.indexdb.getMessagesFromRowId({ minRowId: 999960610, limit: 500 }); ``` ```javascript const messages = await WPP.indexdb.getMessagesFromRowId({ minRowId: 999960610, limit: -1 }); ``` -------------------------------- ### constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.ProductCollCollection.html Initializes a new instance of the ProductCollCollection class. ```APIDOC ## constructor * new ProductCollCollection(e?: any, t?: { parent: any }): ProductCollCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns ProductCollCollection ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.ReactionsModel.html Gets an attribute of the ReactionsModel. ```APIDOC ## get * get(attr: T): ReactionsModel[T] #### Type Parameters * T extends keyof ReactionsModel #### Parameters * attr: T #### Returns ReactionsModel[T] ``` -------------------------------- ### Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.ProductCollection.html Initializes a new instance of the ProductCollection class. ```APIDOC ## constructor * new ProductCollection(e?: any, t?: { parent: any }): ProductCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns ProductCollection ``` -------------------------------- ### initialize Source: https://wppconnect.io/wa-js/classes/whatsapp.AttachMediaModel.html Initializes the AttachMediaModel. ```APIDOC ## initialize ### Description Initializes the AttachMediaModel. ### Method Signature default.initialize(): void ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.BusinessCategoriesResultModel.html Gets an attribute from the model. ```APIDOC ## get(attr: T) ### Description Gets an attribute from the model. ### Type Parameters * T extends keyof BusinessCategoriesResultModel ### Parameters * **attr**: T ### Returns BusinessCategoriesResultModel[T] ``` -------------------------------- ### listenToAndRun Source: https://wppconnect.io/wa-js/classes/whatsapp.ConnModel.html Starts listening to an event and runs a callback function once. ```APIDOC ## listenToAndRun(model: Model, eventName: Event, listener: Listener) ### Description Starts listening to an event and runs a callback function once. ### Parameters * **model**: Model * **eventName**: Event * **listener**: Listener ### Returns this ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.ChatPreferenceModel.html Gets a property value from the model. ```APIDOC ## get(attr: T): ChatPreferenceModel[T] ### Description Gets a property value from the model. ### Type Parameters * T extends keyof ChatPreferenceModel ### Parameters * **attr**: T ### Returns ChatPreferenceModel[T] ``` -------------------------------- ### initializeAltDeviceLinking Source: https://wppconnect.io/wa-js/functions/whatsapp.functions.initializeAltDeviceLinking.html Initializes the alternative device linking process for WhatsApp. This function returns a Promise that resolves when the process is complete. ```APIDOC ## Function initializeAltDeviceLinking ### Description Initializes the alternative device linking process for WhatsApp. This function returns a Promise that resolves when the process is complete. ### Signature `initializeAltDeviceLinking(): Promise` ### Returns - `Promise`: A promise that resolves when the alternative device linking is successfully initialized. ``` -------------------------------- ### Listen for Main Interface Initialization Source: https://wppconnect.io/wa-js/interfaces/ev.ConnEventTypes.html This event is triggered when the @wppconnect/wa-js interface begins its booting process. ```javascript WPP.on('conn.main_init', () => { // Your code }); ``` -------------------------------- ### Get all group keys Source: https://wppconnect.io/wa-js/index.html To get the most up-to-date list of available group functions, run this in your browser console. ```javascript Object.keys(WPP.group).sort() ``` -------------------------------- ### Get all blocklist keys Source: https://wppconnect.io/wa-js/index.html To get the most up-to-date list of available blocklist functions, run this in your browser console. ```javascript Object.keys(WPP.blocklist).sort() ``` -------------------------------- ### Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.ProductImageCollection.html Initializes a new instance of the ProductImageCollection class. ```APIDOC ## constructor * new ProductImageCollection(e?: any, t?: { parent: any }): ProductImageCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns ProductImageCollection ``` -------------------------------- ### Get all contact keys Source: https://wppconnect.io/wa-js/index.html To get the most up-to-date list of available contact functions, run this in your browser console. ```javascript Object.keys(WPP.contact).sort() ``` -------------------------------- ### Get all chat keys Source: https://wppconnect.io/wa-js/index.html To get the most up-to-date list of available chat functions, run this in your browser console. ```javascript Object.keys(WPP.chat).sort() ``` -------------------------------- ### MediaPrep Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.MediaPrep.MediaPrep.html Initializes a new instance of the MediaPrep class. ```APIDOC ## constructor * new MediaPrep(type: OUTWARD_TYPES, p: any): whatsapp.MediaPrep.MediaPrep #### Parameters * type: OUTWARD_TYPES * p: any #### Returns whatsapp.MediaPrep.MediaPrep ``` -------------------------------- ### Clean and Build Specific WA Version Source: https://wppconnect.io/wa-js/index.html Use these commands to clean the 'wa-source' directory, build the project for production, and then launch the local server with a specific WhatsApp Web version. ```bash npm run wa-source:clean ``` ```bash npm run build:prd ``` ```bash WA_VERSION="2.3000.1029560485" npm run launch:local ``` -------------------------------- ### ProductCatalogSession Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.ProductCatalogSession.html Initializes a new instance of the ProductCatalogSession class. ```APIDOC ## constructor * new ProductCatalogSession(e: any): ProductCatalogSession ### Parameters * e: any ### Returns ProductCatalogSession ``` -------------------------------- ### Get Announcement Group ID Source: https://wppconnect.io/wa-js/functions/community.getAnnouncementGroup.html Use this function to get the announcement group ID of a community. You can provide any group ID that belongs to the community. ```javascript WPP.community.getAnnouncementGroup('123456@g.us'); ``` -------------------------------- ### startWebComms Source: https://wppconnect.io/wa-js/functions/whatsapp.websocket.startWebComms.html Initiates the WebSocket communication for WhatsApp. ```APIDOC ## Function startWebComms ### Description Initiates the WebSocket communication for WhatsApp. ### Signature `startWebComms(): Promise` ### Returns - `Promise`: A promise that resolves when the WebSocket communication has started. ``` -------------------------------- ### Get A/B Config Name by Code Source: https://wppconnect.io/wa-js/functions/conn.getABPropName.html Use this function to get the human-readable name associated with a given A/B configuration code. Returns null if the code is not found. ```javascript // Get name from config code const name = WPP.conn.getABPropName('12345'); console.log('Config name:', name); ``` -------------------------------- ### initialize Source: https://wppconnect.io/wa-js/classes/whatsapp.ConnModel.html Initializes the ConnModel. ```APIDOC ## initialize(): void ### Description Initializes the ConnModel. ``` -------------------------------- ### slice Source: https://wppconnect.io/wa-js/classes/whatsapp.OrderItemCollection.html Returns a shallow copy of a portion of the collection into a new array object selected from `start` to `end` where `start` and `end` represent the index of items in the collection. The original collection will not be modified. ```APIDOC ## slice ### Description Returns a shallow copy of a portion of the collection. ### Method `slice(start?: number, end?: number): OrderItemModel[]` ### Parameters * `start` (number) - Optional: The beginning index of the specified portion of the array. If `start` is undefined, the slice begins at index 0. * `end` (number) - Optional: The end index of the specified portion of the array. This is exclusive of the element at the index `end`. If `end` is undefined, then the slice extends to the end of the array. ### Returns `OrderItemModel[]`: A new array containing the selected portion of the collection. ``` -------------------------------- ### initialize Method Source: https://wppconnect.io/wa-js/classes/whatsapp.NoteModel.html Initializes the NoteModel instance. ```APIDOC ### initialize * `initialize(): void` #### Returns void ``` -------------------------------- ### Get Current User LID Source: https://wppconnect.io/wa-js/functions/conn.getMyUserLid.html Call this function to retrieve the LID of the currently logged-in user. The LID is a unique identifier that does not include device details. Use .toString() to get the string representation. ```javascript const lid = WPP.conn.getMyUserLid(); console.log(lid.toString()); // Output: 123@lid ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/modules/status.html Retrieves status information. ```APIDOC ## get ### Description Retrieves status information. ### Method APIDOC ### Endpoint status.get() ### Parameters None ### Response #### Success Response (200) - **status** (any) - Description of the status response #### Response Example { "example": "status response" } ``` -------------------------------- ### Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.ProductMessageListModel.html Initializes a new instance of the ProductMessageListModel class. ```APIDOC ## constructor * new ProductMessageListModel( proterties?: ModelPropertiesContructor, options?: ModelOptions, ): ProductMessageListModel #### Parameters * `Optional`proterties: ModelPropertiesContructor * `Optional`options: ModelOptions #### Returns ProductMessageListModel ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/modules/contact.html Retrieves contact information. ```APIDOC ## get ### Description Retrieves contact information. ### Method APIDOC ### Endpoint contact.get ### Parameters (No parameters specified in the source) ### Request Example (No request example specified in the source) ### Response (No response details specified in the source) ``` -------------------------------- ### initialize Source: https://wppconnect.io/wa-js/classes/whatsapp.BusinessCategoriesResultModel.html Initializes the model. ```APIDOC ## initialize() ### Description Initializes the model. ### Returns void ``` -------------------------------- ### constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.BotProfileCollection.html Initializes a new instance of the BotProfileCollection class. ```APIDOC ## constructor * new BotProfileCollection(e?: any, t?: { parent: any }): BotProfileCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns BotProfileCollection ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.ReactionsCollection.html Retrieves a reaction by its ID. ```APIDOC ## get ### Description Retrieves a reaction by its ID. ### Parameters #### e - **Stringable** - Required ### Returns - **ReactionsModel | undefined** ``` -------------------------------- ### QuickReplyModel Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.QuickReplyModel.html Initializes a new instance of the QuickReplyModel class. It can optionally accept properties and options for configuration. ```APIDOC ## constructor * new QuickReplyModel( proterties?: ModelPropertiesContructor, options?: ModelOptions, ): QuickReplyModel #### Parameters * `Optional`proterties: ModelPropertiesContructor * `Optional`options: ModelOptions #### Returns QuickReplyModel ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.ProductCollCollection.html Retrieves a ProductCollModel by its identifier. ```APIDOC ## get ### Description Retrieves a ProductCollModel by its identifier. ### Parameters * e: Stringable ### Returns ProductCollModel | undefined ``` -------------------------------- ### initialize Method Source: https://wppconnect.io/wa-js/classes/whatsapp.BlocklistModel.html Initializes the model. ```APIDOC ## initialize * initialize(): void #### Returns void ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.NoteCollection.html Retrieves a NoteModel by its identifier. ```APIDOC ## get(e: Stringable): NoteModel | undefined ### Description Retrieves a NoteModel by its identifier. ### Parameters #### e - Stringable ### Returns - NoteModel | undefined ``` -------------------------------- ### Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.BusinessProfileCollection.html Initializes a new instance of the BusinessProfileCollection class. ```APIDOC ## constructor * new BusinessProfileCollection( e?: any, t?: { parent: any }, ): BusinessProfileCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns BusinessProfileCollection ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.MuteCollection.html Retrieves a MuteModel by its identifier. ```APIDOC ## get ### Description Retrieves a MuteModel by its identifier. ### Parameters * e: Stringable - The identifier of the MuteModel to retrieve. ### Returns MuteModel | undefined ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.ModelChatBase.html Retrieves an attribute from the model. ```APIDOC ## get * get(attr: T): ModelChatBase[T] ### Type Parameters * T extends keyof ModelChatBase ### Parameters * attr: T ### Returns ModelChatBase[T] ``` -------------------------------- ### ProductCollCollection.listenToAndRun Source: https://wppconnect.io/wa-js/classes/whatsapp.ProductCollCollection.html Registers a listener for a specific event and immediately executes it. ```APIDOC ## listenToAndRun(context: any, eventName: Event, listener?: Listener): this ### Description Registers a listener for a specific event and immediately executes it. ### Parameters #### context * **context** (any) - The value of `this` provided for the call to `listener`. #### eventName * **eventName** (Event) - The name of the event. #### listener * **listener** (Listener) - Optional. The callback function. ### Returns * this - Returns a reference to the `EventEmitter`, so that calls can be chained. ``` -------------------------------- ### title Source: https://wppconnect.io/wa-js/classes/whatsapp.ChatModel.html Gets the title of the chat. ```APIDOC ## title ### Description Gets the title of the chat. ### Method title() ### Returns any ``` -------------------------------- ### BusinessProfileModel Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.BusinessProfileModel.html Initializes a new instance of the BusinessProfileModel class. ```APIDOC ## constructor BusinessProfileModel ### Description Initializes a new instance of the BusinessProfileModel class. ### Parameters * `Optional` **proterties**: ModelPropertiesContructor * `Optional` **options**: ModelOptions ### Returns BusinessProfileModel ``` -------------------------------- ### constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.MsgCollection.html Initializes a new instance of the MsgCollection class. ```APIDOC ## constructor * new MsgCollection(e?: any, t?: { parent: any }): MsgCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns MsgCollection ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.ButtonCollection.html Retrieves a button by its ID. ```APIDOC ## get ### Description Retrieves a button by its ID. ### Parameters * e: Stringable ### Returns ReplyButtonModel | undefined ``` -------------------------------- ### startGroupCall Source: https://wppconnect.io/wa-js/classes/whatsapp.CmdClass.html Starts a group call. ```APIDOC ## startGroupCall ### Description Starts a group call. ### Method ```javascript startGroupCall(e?: any, t?: any): void ``` ### Parameters * `Optional` **e**: any * `Optional` **t**: any ``` -------------------------------- ### initialize Method Source: https://wppconnect.io/wa-js/classes/whatsapp.CartItemModel.html Initializes the CartItemModel. ```APIDOC ## initialize initialize(): void ### Returns void ``` -------------------------------- ### listenTo Source: https://wppconnect.io/wa-js/classes/whatsapp.RecentEmojiCollection.html Sets up a listener for a specific event on a context. ```APIDOC ## listenTo ### Description Sets up a listener for a specific event on a context. ### Parameters * context: any * eventName: Event * `Optional`listener: Listener ### Returns this ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.StickerPackCollection.html Retrieves a StickerPackModel by its Stringable identifier. ```APIDOC ## get ### Description Retrieves a StickerPackModel by its Stringable identifier. ### Parameters * e: Stringable ### Returns * StickerPackModel | undefined ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.StickerSearchCollection.html Retrieves a StickerModel by its stringable identifier. ```APIDOC ## get ### Description Retrieves a StickerModel by its stringable identifier. ### Parameters * e: Stringable ### Returns StickerModel | undefined ``` -------------------------------- ### Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.OpaqueDataBase.html Initializes a new instance of the OpaqueDataBase class. ```APIDOC ## constructor * new OpaqueDataBase(): OpaqueDataBase ### Returns OpaqueDataBase ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.SocketModel.html Retrieves a specific attribute from the SocketModel. ```APIDOC ## get ### Description Retrieves a specific attribute from the SocketModel. ### Method `get(attr: T): SocketModel[T]` ### Type Parameters * **T** extends `keyof SocketModel` - The type of the attribute to retrieve. ### Parameters * **attr** (T) - The name of the attribute to retrieve. ### Returns Returns the value of the specified attribute. ``` -------------------------------- ### MsgInfoCollection Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.MsgInfoCollection.html Initializes a new instance of the MsgInfoCollection class. ```APIDOC ## constructor * new MsgInfoCollection(e?: any, t?: { parent: any }): MsgInfoCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns MsgInfoCollection ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.RecentEmojiCollection.html Retrieves a RecentEmojiModel by its string representation. ```APIDOC ## get ### Description Retrieves a RecentEmojiModel by its string representation. ### Parameters * e: Stringable ### Returns RecentEmojiModel | undefined ``` -------------------------------- ### Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.StatusV3Collection.html Initializes a new instance of the StatusV3Collection class. ```APIDOC ## constructor * new StatusV3Collection(e?: any, t?: { parent: any }): StatusV3Collection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns StatusV3Collection ``` -------------------------------- ### constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.ReactionsCollection.html Initializes a new instance of the ReactionsCollection class. ```APIDOC ## constructor * new ReactionsCollection(e?: any, t?: { parent: any }): ReactionsCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns ReactionsCollection ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.ProductImageCollection.html Retrieves a ProductImageModel by its string representation. ```APIDOC ## get ### Description Retrieves a ProductImageModel by its string representation. ### Parameters * e: Stringable - The string representation of the ProductImageModel to retrieve. ### Returns ProductImageModel | undefined ``` -------------------------------- ### getProductSize Source: https://wppconnect.io/wa-js/classes/whatsapp.ProductMessageListModel.html Gets the total number of products. ```APIDOC ## getProductSize * getProductSize(): any #### Returns any ``` -------------------------------- ### initialize Source: https://wppconnect.io/wa-js/classes/whatsapp.ChatModel.html Initializes the chat model. ```APIDOC ## initialize ### Description Initializes the chat model. ### Method POST ### Endpoint /chat/{chatId}/initialize ### Returns void ``` -------------------------------- ### constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.CatalogCollection.html Initializes a new instance of the CatalogCollection class. ```APIDOC ## constructor * new CatalogCollection(e?: any, t?: { parent: any }): CatalogCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns CatalogCollection ``` -------------------------------- ### ParticipantCollection.length Source: https://wppconnect.io/wa-js/classes/whatsapp.ParticipantCollection.html Gets the number of participants in the collection. ```APIDOC ## length ### Description Gets the number of participants in the collection. ### Returns number - The number of participants. ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.OrderCollection.html Retrieves an order model by its identifier. ```APIDOC ## get ### Description Retrieves an order model by its identifier. ### Parameters #### Parameters - **e**: Stringable - Required. ### Returns - **OrderModel | undefined** ``` -------------------------------- ### isMainInit() Source: https://wppconnect.io/wa-js/functions/conn.isMainInit.html Checks if the main interface is initializing. Returns a boolean value. ```APIDOC ## isMainInit() ### Description Checks if the main interface is initializing. ### Method JavaScript Function ### Returns - boolean: True if the main interface is initializing, false otherwise. ### Example ```javascript const isMainInit = WPP.conn.isMainInit(); ``` ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.OrderItemCollection.html Retrieves an OrderItemModel by its stringable identifier. ```APIDOC ## get ### Description Retrieves an OrderItemModel by its stringable identifier. ### Parameters * `e`: Stringable - The identifier to search for. ### Returns OrderItemModel | undefined ``` -------------------------------- ### BotProfileModel Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.BotProfileModel.html Initializes a new instance of the BotProfileModel class. ```APIDOC ## constructor * new BotProfileModel( proterties?: ModelPropertiesContructor, options?: ModelOptions, ): BotProfileModel #### Parameters * `Optional`proterties: ModelPropertiesContructor * `Optional`options: ModelOptions #### Returns BotProfileModel ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.MsgCollection.html Retrieves a message from the collection by its ID. ```APIDOC ## get ### Description Retrieves a message from the collection by its ID. ### Parameters #### e - **Stringable** - The ID of the message to retrieve. ### Returns - **MsgModel | undefined** - The message object if found, otherwise undefined. ``` -------------------------------- ### initialize Source: https://wppconnect.io/wa-js/classes/whatsapp.SocketModel.html Initializes the SocketModel instance. ```APIDOC ## initialize ### Description Initializes the SocketModel. ### Method `initialize(): any` ### Returns any ``` -------------------------------- ### constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.ReactionsModel.html Initializes a new instance of the ReactionsModel class. ```APIDOC ## constructor * new ReactionsModel( proterties?: ModelPropertiesContructor, options?: ModelOptions, ): ReactionsModel #### Parameters * `Optional`proterties: ModelPropertiesContructor * `Optional`options: ModelOptions #### Returns ReactionsModel ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.MsgLoad.html Retrieves a message by its stringable identifier. ```APIDOC ## get ### Description Retrieves a message by its stringable identifier. ### Parameters * `e`: Stringable - The stringable identifier of the message. ### Returns MsgModel | undefined ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.LabelItemCollection.html Retrieves an item by its string representation. ```APIDOC ## get ### Description Retrieves an item by its string representation. ### Parameters * e: Stringable ### Returns LabelItemModel | undefined ``` -------------------------------- ### constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.NoteCollection.html Initializes a new instance of the NoteCollection class. ```APIDOC ## constructor * new NoteCollection(e?: any, t?: { parent: any }): NoteCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns NoteCollection ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.EmojiVariantCollection.html Retrieves an EmojiVariantModel by its string representation. ```APIDOC ## get ### Description Retrieves an EmojiVariantModel by its string representation. ### Parameters * e: Stringable - The string representation of the emoji variant. ### Returns EmojiVariantModel | undefined ``` -------------------------------- ### conn.main_ready Source: https://wppconnect.io/wa-js/interfaces/ev.ConnEventTypes.html Triggered when the main interface is loaded, authenticated, and ready to send messages. ```APIDOC ## conn.main_ready ### Description Triggered when the main interface is loaded, authenticated, and ready to send messages. ### Event Name `conn.main_ready` ### Example ```javascript WPP.on('conn.main_ready', () => { // Your code }); ``` ``` -------------------------------- ### getEphemeralSettingTimestamp Source: https://wppconnect.io/wa-js/classes/whatsapp.ChatModel.html Gets the timestamp for the ephemeral setting. ```APIDOC ## getEphemeralSettingTimestamp ### Description Gets the timestamp for the ephemeral setting. ### Method GET ### Endpoint /chat/{chatId}/ephemeral-setting/timestamp ### Returns any ``` -------------------------------- ### getEphemeralSetting Source: https://wppconnect.io/wa-js/classes/whatsapp.ChatModel.html Gets the ephemeral setting for the chat. ```APIDOC ## getEphemeralSetting ### Description Gets the ephemeral setting for the chat. ### Method GET ### Endpoint /chat/{chatId}/ephemeral-setting ### Returns any ``` -------------------------------- ### listenTo Source: https://wppconnect.io/wa-js/classes/whatsapp.ParticipantCollection.html Sets up a listener for a specific event. ```APIDOC ## listenTo ### Description Sets up a listener for a specific event. ### Parameters * **context** (any) - The value of `this` provided for the call to `listener`. * **eventName** (Event) - The name of the event. * **listener** (Listener) - Optional. The callback function. ### Returns * this - Returns a reference to the EventEmitter for chaining. ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.ConnModel.html Retrieves a specific attribute from the ConnModel. ```APIDOC ## get(attr: T): ConnModel[T] ### Description Retrieves a specific attribute from the ConnModel. ### Parameters * **attr** (T) - The attribute key to retrieve. ``` -------------------------------- ### MsgInfoModel Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.MsgInfoModel.html Initializes a new instance of the MsgInfoModel class. It accepts optional properties and options for configuration. ```APIDOC ## constructor * new MsgInfoModel( proterties?: ModelPropertiesContructor, options?: ModelOptions, ): MsgInfoModel #### Parameters * `Optional`proterties: ModelPropertiesContructor * `Optional`options: ModelOptions #### Returns MsgInfoModel ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.ChatCollection.html Retrieves a chat by its stringable ID. ```APIDOC ## get ### Description Retrieves a chat by its stringable ID. ### Parameters * e: Stringable ### Returns ChatModel | undefined ``` -------------------------------- ### Listen for Main Interface Ready Source: https://wppconnect.io/wa-js/interfaces/ev.ConnEventTypes.html This event indicates that the main interface is fully loaded, authenticated, and ready to send messages. ```javascript WPP.on('conn.main_ready', () => { // Your code }); ``` -------------------------------- ### getDefault Source: https://wppconnect.io/wa-js/classes/whatsapp.ChatPreferenceModel.html Gets the default value for a property. ```APIDOC ## getDefault(attr: T): any ### Description Gets the default value for a property. ### Type Parameters * T extends keyof ChatPreferenceModel ### Parameters * **attr**: T ### Returns any ``` -------------------------------- ### listenTo Source: https://wppconnect.io/wa-js/classes/whatsapp.MsgLoad.html Sets up a listener for a specific event, binding the context for the listener's callback. ```APIDOC ## listenTo ### Description Sets up a listener for a specific event, binding the context for the listener's callback. ### Method ```javascript listenTo(context: any, eventName: Event, listener?: Listener): this ``` ### Parameters #### Path Parameters - **context** (any) - Required - The value of `this` provided for the call to `listener`. - **eventName** (Event) - Required - The name of the event. - **listener** (Listener) - Optional - The callback function. ### Returns - this: Returns a reference to the `EventEmitter` for chaining. ``` -------------------------------- ### comparator Source: https://wppconnect.io/wa-js/classes/whatsapp.ButtonCollection.html Static method to get a comparator. ```APIDOC ## comparator ### Description Static method to get a comparator. ### Method Signature `comparator(): any` ### Returns `any` - The comparator. ``` -------------------------------- ### Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.LabelItemModel.html Initializes a new instance of the LabelItemModel class. ```APIDOC ## constructor * new LabelItemModel( proterties?: ModelPropertiesContructor, options?: ModelOptions, ): LabelItemModel #### Parameters * `Optional`proterties: ModelPropertiesContructor * `Optional`options: ModelOptions #### Returns LabelItemModel ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.CartCollection.html Retrieves a cart item by its identifier. ```APIDOC ## get(e: Stringable): CartModel | undefined ### Description Retrieves a cart item by its identifier. ### Parameters #### Path Parameters * e (Stringable) - Required ### Returns CartModel | undefined ``` -------------------------------- ### constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.StarredMsgCollection.html Initializes a new instance of StarredMsgCollection. ```APIDOC ## constructor * new StarredMsgCollection(e?: any, t?: { parent: any }): StarredMsgCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns StarredMsgCollection ``` -------------------------------- ### listenTo Source: https://wppconnect.io/wa-js/classes/whatsapp.BusinessCategoriesResultCollection.html Sets up a listener for a specific event, optionally with a context and a callback function. ```APIDOC ## listenTo ### Description Sets up a listener for a specific event. ### Parameters #### Parameters - **context** (any) - Required - The value of `this` provided for the call to `listener`. - **eventName** (Event) - Required - The name of the event. - **listener** (Listener) - Optional - The callback function. ### Returns this ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.AggReactionsCollection.html Retrieves a specific AggReactionsModel by its identifier. ```APIDOC ## get ### Description Retrieves a specific AggReactionsModel by its identifier. ### Parameters * e: Stringable ### Returns AggReactionsModel | undefined ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.BotProfileCollection.html Retrieves a BotProfileModel by its string representation. ```APIDOC ## get ### Description Retrieves a BotProfileModel by its string representation. ### Parameters * e: Stringable ### Returns BotProfileModel | undefined ``` -------------------------------- ### constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.ReplyButtonModel.html Initializes a new instance of the ReplyButtonModel class. ```APIDOC ## constructor * new ReplyButtonModel( proterties?: ModelPropertiesContructor, options?: ModelOptions, ): ReplyButtonModel #### Parameters * `Optional`proterties: ModelPropertiesContructor * `Optional`options: ModelOptions #### Returns ReplyButtonModel ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.BaseCollection.html Retrieves an item by its string identifier. ```APIDOC ## get ### Description Retrieves an item by its string identifier. ### Parameters - **e** (Stringable): The string identifier of the item. ### Returns - **C | undefined**: The item if found, otherwise undefined. ``` -------------------------------- ### constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.AggReactionsCollection.html Initializes a new instance of AggReactionsCollection. ```APIDOC ## constructor * new AggReactionsCollection(e?: any, t?: { parent: any }): AggReactionsCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns AggReactionsCollection ``` -------------------------------- ### BlocklistCollection.length Source: https://wppconnect.io/wa-js/classes/whatsapp.BlocklistCollection.html Gets the number of items in the collection. ```APIDOC ## length * get length(): number #### Returns number ``` -------------------------------- ### getDefault Source: https://wppconnect.io/wa-js/classes/whatsapp.BusinessCategoriesResultModel.html Gets the default value of an attribute. ```APIDOC ## getDefault(attr: T) ### Description Gets the default value of an attribute. ### Type Parameters * T extends keyof BusinessCategoriesResultModel ### Parameters * **attr**: T ### Returns any ``` -------------------------------- ### Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.BusinessCategoriesResultModel.html Initializes a new instance of the BusinessCategoriesResultModel class. ```APIDOC ## new BusinessCategoriesResultModel() ### Description Initializes a new instance of the BusinessCategoriesResultModel class. ### Parameters * `Optional` **proterties**: ModelPropertiesContructor * `Optional` **options**: ModelOptions ### Returns BusinessCategoriesResultModel ``` -------------------------------- ### Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.BusinessCategoriesResultCollection.html Initializes a new instance of the BusinessCategoriesResultCollection class. ```APIDOC ## constructor * new BusinessCategoriesResultCollection( e?: any, t?: { parent: any }, ): BusinessCategoriesResultCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns BusinessCategoriesResultCollection ``` -------------------------------- ### getCollection Source: https://wppconnect.io/wa-js/classes/whatsapp.BusinessCategoriesResultModel.html Gets the collection associated with the model. ```APIDOC ## getCollection() ### Description Gets the collection associated with the model. ### Returns BusinessCategoriesResultCollection ``` -------------------------------- ### initialize Source: https://wppconnect.io/wa-js/classes/whatsapp.ContactModel.html Initializes the ContactModel. ```APIDOC ## initialize ### Description Initializes the ContactModel. This method is called internally when the model is created or needs to be set up. ### Method initialize(): void ### Returns void ``` -------------------------------- ### listenToAndRun Method Source: https://wppconnect.io/wa-js/classes/whatsapp.BlocklistModel.html Listens to events on a specified context and runs the listener immediately. ```APIDOC ## listenToAndRun * listenToAndRun(context: any, eventName: Event, listener?: Listener): this #### Parameters * context: any The value of `this` provided for the call to `listener` * eventName: Event The name of the event. * `Optional`listener: Listener The callback function. #### Returns this ``` -------------------------------- ### constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.RecentStickerModel.html Initializes a new instance of RecentStickerModel. ```APIDOC ## constructor * new RecentStickerModel( proterties?: ModelPropertiesContructor, options?: ModelOptions, ): RecentStickerModel #### Parameters * `Optional`proterties: ModelPropertiesContructor * `Optional`options: ModelOptions #### Returns RecentStickerModel ``` -------------------------------- ### Get All Labels Source: https://wppconnect.io/wa-js/modules/labels.html Retrieves all labels associated with the account. ```APIDOC ## getAllLabels ### Description Retrieves all labels from the account. ### Signature getAllLabels(): Promise ``` -------------------------------- ### Launch Local Development Server Source: https://wppconnect.io/wa-js/index.html This command launches a local browser with automatic injection of WA-JS. It also caches files in the 'wa-source' directory for faster subsequent requests. ```bash npm run launch:local ``` -------------------------------- ### getStatus Source: https://wppconnect.io/wa-js/functions/contact.getStatus.html Get the current text status of a contact. ```APIDOC ## getStatus ### Description Get the current text status of a contact. ### Method `getStatus(contactId: string | Wid): Promise` ### Parameters #### Path Parameters - **contactId** (string | Wid) - Required - The ID of the contact whose status needs to be retrieved. ### Response #### Success Response - **string | null**: The current text status of the contact, or null if no status is found. ### Example ```javascript await WPP.contact.getStatus('[number]@c.us'); ``` ``` -------------------------------- ### MediaEntry Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.MediaEntry.html Initializes a new instance of the MediaEntry class. ```APIDOC ## Constructor ### `new MediaEntry()` Initializes a new instance of the MediaEntry class. #### Returns - `MediaEntry`: A new instance of the MediaEntry class. ``` -------------------------------- ### get(chatId) Source: https://wppconnect.io/wa-js/functions/chat.get.html Finds a chat by its unique identifier. ```APIDOC ## get(chatId) ### Description Find a chat by id. ### Parameters #### Path Parameters * **chatId** (string | Wid) - Required - The ID of the chat to find. ### Returns * **ChatModel | undefined** - The found chat model or undefined if not found. ``` -------------------------------- ### get Source: https://wppconnect.io/wa-js/classes/whatsapp.TemplateButtonCollection.html Retrieves a template button by its stringable identifier. ```APIDOC ## get ### Description Retrieves a template button by its stringable identifier. ### Parameters * `e`: Stringable - The identifier for the template button. ### Returns TemplateButtonModel | undefined ``` -------------------------------- ### ProductMessageListCollection Constructor Source: https://wppconnect.io/wa-js/classes/whatsapp.ProductMessageListCollection.html Initializes a new instance of the ProductMessageListCollection class. ```APIDOC ## constructor * new ProductMessageListCollection( e?: any, t?: { parent: any }, ): ProductMessageListCollection #### Parameters * `Optional`e: any * `Optional`t: { parent: any } #### Returns ProductMessageListCollection ```