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
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
As of WhatsApp Web v2.2035.12, the structure of the return value for `uploadMedia()` now returns an object that contains the previously returned data in its `mediaEntry` property.
fix#318
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
After this commit, chats will be automatically marked as seen when a message is sent to it. If this is not the intended behavior, `sendSeen: false` can be set as part of the options object.
You can also manually mark a conversation as seen by calling the sendSeen() function on the Chat.
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
* feat : Check if the given number is a whatsapp number
- Avoids sending message to non whatsapp number
- Gets the id of the user from whatsapp server rather than generating on client