Adds the option `sendMediaAsSticker` that will take care of converting media to appropriate formats and send it as a sticker. Note that ffmpeg is required to properly convert animated stickers that are not in webp format.
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
Exposes internal getNumberById function for easy usage.
This can help with dealing with brazilian numbers with the extra digit, always returning the correct ID.
This will probably eventually replace the current isRegisteredUser function.
Co-authored-by: Pedro Lopez <pedroslopez@me.com>
* Get all labels
* Get chats by label
* Get labels assigned to chats
Co-authored-by: Pedro S. Lopez <pslamoros@hotmail.com>
Co-authored-by: Pedro Lopez <pedroslopez@me.com>
Introduces the ability to send contact cards. You can send Contacts directly or send a vCard string and it will be automatically parsed. If you'd like to disable this autoparse functionality, you can set `parseVCards: false` as an option while sending a message.
close#293
Moving this to a serializer function like done with a couple other models guarantees getting messages with pending acks won't fail elsewhere. It also sets it up so the we can add/remove properties on the Message model as needed in the future.
related: 51a1028588
As of WhatsApp Web v2.2041.6, a "pendingAckUpdate" property was added to the Message model that persists on serialization but is a non-serializable type. This fix removes it from the change:ack so it can be properly sent through puppeteer.
fix#371
GroupMetadata was only loaded for the first couple chats, so you could not access it on older group chats without performing an action that would update its state
close#264
* chore: add ClientOptions and ClientInfo in JSDoc
* chore: add MessageSendOptions type
* chore: add ClientSession type in JSDoc
* chore: remove @todo from createGroup (was already solved)
Co-authored-by: Pedro Lopez <pedroslopez@me.com>
* Added Option to Custom User Agent in Client
* Update Typescript Index
* Delete Variable UserAgent From Client
* Update Variable UserAgent to userAgent
Since static methods do not have access to `this.client`, it was giving an error when trying to call these functions. The client itself is a better place for them.
close#258
After this commit, previews for links will be enabled by default. To disable it, use linkPreview: false as an option when sending the message.
close#98
This moves the function from Contact to Client to enable getting profile picture without requiring a conversation before. The old function is still available on Contact for convenience and backwards-compatibility.
New "change_battery" event is triggered when the battery percentage changes. Has current battery percentage and charging state as object param.
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
* move this.pupBrowser variable to line 51 to resolve not being able to close the browser when it is not connected to the internet
* move pupPage along with pupBrowser
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
Messages created by the current client don't have attatched media on message_create because it is still being uploaded and sent. This event allows you to detect when the media has been properly sent so it can be downloaded.
close#111