Skip to content

Releases: pedroslopez/whatsapp-web.js

v1.12.4

11 Feb 22:51
Compare
Choose a tag to compare

This release fixes an issue with sending stickers on WhatsApp Web v2.2104.6.

v1.12.3 - TS typedef fix for some users

09 Feb 19:54
Compare
Choose a tag to compare

Type definitions were causing an error on build for some TypeScript users. This release addresses the issue.

Changelog

d96e8e5 - chore: mark version v1.12.3
0cbb037 - fix(ts): getNumberId typings caused error on build
1f75614 - ignore logs on npm publish

v1.12.2 - Fix download/send media on WhatsApp Web v2.2104.6

09 Feb 04:53
Compare
Choose a tag to compare

Important update

WhatsApp Web v2.2104.6 has introduced breaking changes that impact the ability to send and download media. This release addresses these issues, and updating is required.

Changelog

4047afe - chore: mark version v1.12.2
89029ac - add docs
fa4923d - fixed acceptInvite typings
559133c - fix: upload media on WhatsApp Web v2.2104.6
e2acd03 - fix: download media on WhatsApp Web v2.2104.6
c697429 - chore: mark version v1.12.1
6590c75 - fix (ts): include pupPage and pupBrowser properties on Client typedef

v1.12.0

29 Dec 05:01
Compare
Choose a tag to compare

This is a big one! v1.12.0 introduces many long-awaited features thanks to our great contributors.

What's New

Send stickers

You can finally send stickers with the library! Stickers are sent just like any other media type. You just need to make sure to specify the option sendMediaAsSticker: true when sending the message:

const sticker = MessageMedia.fromFilePath('/path/to/image.png');
chat.sendMessage(sticker, { sendMediaAsSticker: true });

The library takes care of converting the media internally to an acceptable format.

Animated stickers are also supported, but it's worth noting that conversion to webp is done through ffmpeg. You'll need to have it installed if you want to send animated stickers that are not already in webp format. By default the ffmpeg path is set to ffmpeg, but if you have it installed in a different path, you can set it manually when creating the client:

const client = new Client({
    ffmpegPath: '/path/to/ffmpeg.exe'
});

Send media as document/file

Much like sending stickers, you can now send media files like pictures, audio and video as documents by using the sendMediaAsDocument: true option when sending the message:

const media = MessageMedia.fromFilePath('/path/to/image.png');
chat.sendMessage(media, { sendMediaAsDocument: true });

Messages

Some new features have been added to the Message model:

  • Star/unstar messages (msg.star() and msg.unstar()) and get the current star status msg.isStarred
  • Get parsed links included in the message (msg.links)
  • Get detailed message delivery information. This will allow you to see who and when group messages have been delivered/read/played by each participant. (msg.getInfo())

Business Labels

If you're running WhatsApp Business:

// Get labels
const labels = await client.getLabels();
const label = await client.getLabelById(labelId);

// Get Chat's assigned labels
const labels = await chat.getLabels();
const labels = await client.getChatLabels(chatId);

// Get Chats for a specific label
const chats = await label.getChats();
const chats = await client.getChatsByLabelId(labelId);

Contact "About" info

You can now get a Contact's "About" text (previously named "Status"). This can return null if you don't have permission to read their status.

const aboutText = await contact.getAbout();

and more...

Change log

1bdc733 - chore: mark version v1.12.0
bb9d160 - docs: switch links to point to the guide
cea1830 - docs: fix error generating Label docs
f639c53 - feat: Get message delivery information (close #418)
3e32fe2 - feat: mark chat as unread (#475)
5c61957 - feat: add GroupChat types (#485)
3257549 - docs: fix typo
5a0ccc8 - feat: added starred indicator to messages (#501)
1b94694 - feat: star/unstar messages (#494)
71dbe99 - feat: get Contact's "About" text (close #491)
8b101d1 - feat: get links included in message (#457)
e2a642a - feat: send media as stickers (#479)
0c0a5a7 - docs: fix slight typo
e141a5d - feat: send media as document (#490)
576768e - feat: Get registered ID for a given phone number (#483)
87cb5a0 - feat(interface): Open chat search, open chat at message position (#447)
274d240 - feat: WA Business Labels support (#407)

v1.11.2

22 Dec 02:18
Compare
Choose a tag to compare

This release fixes an issue when getting official WhatsApp Business chats with pending button replies.

Change log

563f73d - chore: mark version v1.11.2
4b3079d - chore: bump supported WhatsApp Web version to v2.2049.10
7b0e356 - chore: ignore all session files on npm
467f2af - fix: properly serialize chats with pending button replies

v1.11.1 - WhatsApp Web v2.2047.10 compatibility

19 Nov 19:12
Compare
Choose a tag to compare

This release addresses compatibility issues with WhatsApp Web v2.2047.10. Updating is required.

Changelog

a1d09e0 - fix: fetchMessages when msgs length is smaller than limit (#438)
d86ccec - fix: Expose store on WhatsApp Web v2.2047.10 (#437)

v1.11.0 - WhatsApp Web v2.2045.15 compatibility, Contact features

05 Nov 06:23
Compare
Choose a tag to compare

Important update

Whatsapp Web v2.2045.15 has introduced breaking changes that impact the ability to send messages and get chats. This release addresses these issues, and updating is required.

New features

Send Contacts

You can pass an instance of the Contact object to send WhatsApp contacts:

chat.sendMessage(contact);  // Single contact
chat.sendMessage([contact1, contact2]); // List of contacts

You can also send vCard strings as the message body and they will be automatically parsed and transformed into contact cards:

chat.sendMessage("BEGIN:VCARD\nVERSION:3.0\nN: ....");

This functionality is enabled by default, but if you would like to turn off auto vCard parsing, you can do so by passing an option to the sendMessage function:

chat.sendMessage("BEGIN:VCARD\nVERSION:3.0\nN: ...", {
    parseVCards: false
})

Block Contacts

You can now block / unblock contacts:

contact.block();
contact.unblock();

Get multiple vCards

Previously, you weren't able to get the vCard data if multiple contacts were sent at once. Now you can do so with the message's vCard property:

message.vCards;
// returns ["BEGIN:VCARD\nVERSION:3.0\nN: ...", "BEGIN:VCARD\nVERSION:3.0\nN: ..." ]

Deprecations

client.info.me has been deprecated due to a change in WhatsApp Web internals. Instead, you should use client.info.wid to get the current user ID. The old property will continue working, but you should change all occurrences to the new property since it will be removed on a later release.

Changelog

709c43c - feat: add received vcards to the message (#400)
43aa6b3 - chore: add blocking functionality to readme
fc7a1a9 - fix: address removal of Conn.me This change on WhatsApp Web v2.2045.15 caused errors when sending messages and getting the current user id
b0465ce - fix: expose GroupMetadata WhatsApp Web v2.2045.15+ no longer has this in the store by default
e520a96 - fix: serialize msgs.buttons and delete msgs from chat model (#402)
75296b6 - feat: add received vcards to the message.
b15ec76 - fix: show multiple vcard as array in body
42dd866 - feat: boolean for indicating Status update messages (#396)
20e07c4 - feat: block/unblock contacts (#397)
9b096db - feat: Send contacts (#395)
668106b - chore: add group settings functionality to readme

v1.10.0 - Send media fix, modify group settings, pin chats

21 Oct 19:29
Compare
Choose a tag to compare

Important update

This release fixes an issue introduced in WhatsApp Web v2.2043.8 that prevented media messages from being sent reliably. Updating to this version is required to continue sending media messages.

New features

Modify group settings

It is now possible change group settings so that only admins can send messages or only admins can update group info (description, title, image). Note that you need to have the proper permissions for these changes to take effect.

group.setInfoAdminsOnly(true); // Only admins can edit group info
group.setInfoAdminsOnly(false); // Everyone can edit group info

group.setMessagesAdminsOnly(true); // Only admins can send messages
group.setMessagesAdminsOnly(false); // Everyone can send messages

Pin Chats

You can now pin/unpin chats to the top of the list through the library:

chat.pin(); // pins the chat
chat.unpin(); // unpins the chat

chat.pinned; // indicates if the chat is pinned or not

Changelog

3d06bab - chore: mark version v1.10.0
f4a2c44 - chore: bump supported WhatsApp Web version to v2.2043.8
604656c - fix: change OpaqueData module lookup function (#391)
aedf41b - feat: Pin and unpin Chats (#166)
bf2775d - feat: update group settings (messages and set info admins only) (#374)

v1.9.0 - message_ack fix, chat mute timestamps

09 Oct 06:49
Compare
Choose a tag to compare

This release fixes an issue processing message_ack events due to a change in WhatsApp Web v2.2041.6.
It also introduces a couple properties on Chats for handling muted chats: .isMuted and .muteExpiration.

Change log

0b11200 - chore: mark version v1.9.0
336fb9b - chore: update supported WhatsApp Web version to v2.2041.6
ba6ec7f - fix: apply message serialization fix everywhere
51a1028 - fix: remove pendingAckUpdate from serialization on changed message ack
1c31139 - fix(types): add missing type defs for chat.muteExpiration
ee21e14 - feat: indicate if chat is currently muted
cbf8fb7 - feat: chat mute expiration timestamp (#351)

v1.8.2

01 Sep 19:27
Compare
Choose a tag to compare

This release fixes an issue when getting groupMetadata (participants, description...) for older groups.

Change log

7fcd43f - chore: mark version v1.8.2
a60f0ce - chore: update supported WhatsApp Web version to v2.2035.14
ab0db80 - fix: reliably get group metadata
e7c76fe - chore: update puppeteer to v5.2.1
233382c - chore: ignore test session files when pushing to git
e08dd7d - chore: add .npmignore for smaller package size
a1e8e8c - chore: bump version to v1.8.1-post