-

npm Depfu WhatsApp_Web 2.2240.7 Discord Chat

+

npm Depfu WhatsApp_Web 2.2241.6 Discord Chat

whatsapp-web.js

A WhatsApp API client that connects through the WhatsApp Web browser app

It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.

@@ -3276,7 +3276,7 @@ client.initialize();
diff --git a/docs/structures_Base.js.html b/docs/structures_Base.js.html index 65d6ae7..df20a92 100644 --- a/docs/structures_Base.js.html +++ b/docs/structures_Base.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/Base.js + whatsapp-web.js 1.18.2 » Source: structures/Base.js @@ -15,7 +15,7 @@ @@ -60,7 +60,7 @@ module.exports = Base;
diff --git a/docs/structures_BusinessContact.js.html b/docs/structures_BusinessContact.js.html index c6740cb..90aaecc 100644 --- a/docs/structures_BusinessContact.js.html +++ b/docs/structures_BusinessContact.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/BusinessContact.js + whatsapp-web.js 1.18.2 » Source: structures/BusinessContact.js @@ -15,7 +15,7 @@ @@ -59,7 +59,7 @@ module.exports = BusinessContact;
diff --git a/docs/structures_Buttons.js.html b/docs/structures_Buttons.js.html index 8be1944..4699fde 100644 --- a/docs/structures_Buttons.js.html +++ b/docs/structures_Buttons.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/Buttons.js + whatsapp-web.js 1.18.2 » Source: structures/Buttons.js @@ -15,7 +15,7 @@ @@ -120,7 +120,7 @@ module.exports = Buttons;
diff --git a/docs/structures_Call.js.html b/docs/structures_Call.js.html index 81cb49b..2118c5d 100644 --- a/docs/structures_Call.js.html +++ b/docs/structures_Call.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/Call.js + whatsapp-web.js 1.18.2 » Source: structures/Call.js @@ -15,7 +15,7 @@ @@ -106,7 +106,7 @@ module.exports = Call;
diff --git a/docs/structures_Chat.js.html b/docs/structures_Chat.js.html index 5521da6..96fe03d 100644 --- a/docs/structures_Chat.js.html +++ b/docs/structures_Chat.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/Chat.js + whatsapp-web.js 1.18.2 » Source: structures/Chat.js @@ -15,7 +15,7 @@ @@ -299,7 +299,7 @@ module.exports = Chat;
diff --git a/docs/structures_ClientInfo.js.html b/docs/structures_ClientInfo.js.html index f591d3d..71f9642 100644 --- a/docs/structures_ClientInfo.js.html +++ b/docs/structures_ClientInfo.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/ClientInfo.js + whatsapp-web.js 1.18.2 » Source: structures/ClientInfo.js @@ -15,7 +15,7 @@ @@ -109,7 +109,7 @@ module.exports = ClientInfo;
diff --git a/docs/structures_Contact.js.html b/docs/structures_Contact.js.html index 9280f80..39cbc5f 100644 --- a/docs/structures_Contact.js.html +++ b/docs/structures_Contact.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/Contact.js + whatsapp-web.js 1.18.2 » Source: structures/Contact.js @@ -15,7 +15,7 @@ @@ -245,7 +245,7 @@ module.exports = Contact;
diff --git a/docs/structures_GroupChat.js.html b/docs/structures_GroupChat.js.html index a3043e0..1faee56 100644 --- a/docs/structures_GroupChat.js.html +++ b/docs/structures_GroupChat.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/GroupChat.js + whatsapp-web.js 1.18.2 » Source: structures/GroupChat.js @@ -15,7 +15,7 @@ @@ -272,7 +272,7 @@ module.exports = GroupChat;
diff --git a/docs/structures_GroupNotification.js.html b/docs/structures_GroupNotification.js.html index dcc45b4..2941245 100644 --- a/docs/structures_GroupNotification.js.html +++ b/docs/structures_GroupNotification.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/GroupNotification.js + whatsapp-web.js 1.18.2 » Source: structures/GroupNotification.js @@ -15,7 +15,7 @@ @@ -143,7 +143,7 @@ module.exports = GroupNotification;
diff --git a/docs/structures_Label.js.html b/docs/structures_Label.js.html index 8edcac8..5fc785d 100644 --- a/docs/structures_Label.js.html +++ b/docs/structures_Label.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/Label.js + whatsapp-web.js 1.18.2 » Source: structures/Label.js @@ -15,7 +15,7 @@ @@ -88,7 +88,7 @@ module.exports = Label;
diff --git a/docs/structures_List.js.html b/docs/structures_List.js.html index 85ada9e..0e2c027 100644 --- a/docs/structures_List.js.html +++ b/docs/structures_List.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/List.js + whatsapp-web.js 1.18.2 » Source: structures/List.js @@ -15,7 +15,7 @@ @@ -118,7 +118,7 @@ module.exports = List;
diff --git a/docs/structures_Location.js.html b/docs/structures_Location.js.html index 788874f..353d381 100644 --- a/docs/structures_Location.js.html +++ b/docs/structures_Location.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/Location.js + whatsapp-web.js 1.18.2 » Source: structures/Location.js @@ -15,7 +15,7 @@ @@ -71,7 +71,7 @@ module.exports = Location;
diff --git a/docs/structures_Message.js.html b/docs/structures_Message.js.html index 193ada0..259bc90 100644 --- a/docs/structures_Message.js.html +++ b/docs/structures_Message.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/Message.js + whatsapp-web.js 1.18.2 » Source: structures/Message.js @@ -15,7 +15,7 @@ @@ -569,7 +569,7 @@ module.exports = Message;
diff --git a/docs/structures_MessageMedia.js.html b/docs/structures_MessageMedia.js.html index 07dc863..1c3f7aa 100644 --- a/docs/structures_MessageMedia.js.html +++ b/docs/structures_MessageMedia.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/MessageMedia.js + whatsapp-web.js 1.18.2 » Source: structures/MessageMedia.js @@ -15,7 +15,7 @@ @@ -150,7 +150,7 @@ module.exports = MessageMedia;
diff --git a/docs/structures_Order.js.html b/docs/structures_Order.js.html index e2b2716..313a26f 100644 --- a/docs/structures_Order.js.html +++ b/docs/structures_Order.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/Order.js + whatsapp-web.js 1.18.2 » Source: structures/Order.js @@ -15,7 +15,7 @@ @@ -90,7 +90,7 @@ module.exports = Order;
diff --git a/docs/structures_Payment.js.html b/docs/structures_Payment.js.html index bb84d74..a4f19c6 100644 --- a/docs/structures_Payment.js.html +++ b/docs/structures_Payment.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/Payment.js + whatsapp-web.js 1.18.2 » Source: structures/Payment.js @@ -15,7 +15,7 @@ @@ -118,7 +118,7 @@ module.exports = Payment;
diff --git a/docs/structures_PrivateChat.js.html b/docs/structures_PrivateChat.js.html index 100c403..3d1b457 100644 --- a/docs/structures_PrivateChat.js.html +++ b/docs/structures_PrivateChat.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/PrivateChat.js + whatsapp-web.js 1.18.2 » Source: structures/PrivateChat.js @@ -15,7 +15,7 @@ @@ -51,7 +51,7 @@ module.exports = PrivateChat;
diff --git a/docs/structures_PrivateContact.js.html b/docs/structures_PrivateContact.js.html index ebea085..8e24243 100644 --- a/docs/structures_PrivateContact.js.html +++ b/docs/structures_PrivateContact.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/PrivateContact.js + whatsapp-web.js 1.18.2 » Source: structures/PrivateContact.js @@ -15,7 +15,7 @@ @@ -51,7 +51,7 @@ module.exports = PrivateContact;
diff --git a/docs/structures_Product.js.html b/docs/structures_Product.js.html index 7fccd8a..b3d345e 100644 --- a/docs/structures_Product.js.html +++ b/docs/structures_Product.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/Product.js + whatsapp-web.js 1.18.2 » Source: structures/Product.js @@ -15,7 +15,7 @@ @@ -106,7 +106,7 @@ module.exports = Product;
diff --git a/docs/structures_ProductMetadata.js.html b/docs/structures_ProductMetadata.js.html index 62e786b..f4b68e2 100644 --- a/docs/structures_ProductMetadata.js.html +++ b/docs/structures_ProductMetadata.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/ProductMetadata.js + whatsapp-web.js 1.18.2 » Source: structures/ProductMetadata.js @@ -15,7 +15,7 @@ @@ -63,7 +63,7 @@ module.exports = ProductMetadata;
diff --git a/docs/structures_Reaction.js.html b/docs/structures_Reaction.js.html index bcdc65e..2efca66 100644 --- a/docs/structures_Reaction.js.html +++ b/docs/structures_Reaction.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: structures/Reaction.js + whatsapp-web.js 1.18.2 » Source: structures/Reaction.js @@ -15,7 +15,7 @@ @@ -107,7 +107,7 @@ module.exports = Reaction;
diff --git a/docs/util_Constants.js.html b/docs/util_Constants.js.html index 84a5d6f..1169b26 100644 --- a/docs/util_Constants.js.html +++ b/docs/util_Constants.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: util/Constants.js + whatsapp-web.js 1.18.2 » Source: util/Constants.js @@ -15,7 +15,7 @@ @@ -200,7 +200,7 @@ exports.MessageAck = {
diff --git a/docs/util_InterfaceController.js.html b/docs/util_InterfaceController.js.html index a036bd6..d034985 100644 --- a/docs/util_InterfaceController.js.html +++ b/docs/util_InterfaceController.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: util/InterfaceController.js + whatsapp-web.js 1.18.2 » Source: util/InterfaceController.js @@ -15,7 +15,7 @@ @@ -160,7 +160,7 @@ module.exports = InterfaceController;
diff --git a/docs/util_Util.js.html b/docs/util_Util.js.html index 6906bf1..a21b145 100644 --- a/docs/util_Util.js.html +++ b/docs/util_Util.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.0 » Source: util/Util.js + whatsapp-web.js 1.18.2 » Source: util/Util.js @@ -15,7 +15,7 @@ @@ -225,7 +225,7 @@ module.exports = Util; diff --git a/package.json b/package.json index e7e47ae..90094ea 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "whatsapp-web.js", - "version": "1.18.0", + "version": "1.18.2", "description": "Library for interacting with the WhatsApp Web API ", "main": "./index.js", "typings": "./index.d.ts", diff --git a/src/util/Injected.js b/src/util/Injected.js index dca1f80..fe02ab3 100644 --- a/src/util/Injected.js +++ b/src/util/Injected.js @@ -13,7 +13,6 @@ exports.ExposeStore = (moduleRaidStr) => { window.Store.Cmd = window.mR.findModule('Cmd')[0].Cmd; window.Store.CryptoLib = window.mR.findModule('decryptE2EMedia')[0]; window.Store.DownloadManager = window.mR.findModule('downloadManager')[0].downloadManager; - window.Store.MDBackend = window.mR.findModule('isMDBackend')[0].isMDBackend(); window.Store.Features = window.mR.findModule('FEATURE_CHANGE_EVENT')[0].LegacyPhoneFeatures; window.Store.GroupMetadata = window.mR.findModule((module) => module.default && module.default.handlePendingInvite)[0].default; window.Store.Invite = window.mR.findModule('sendJoinGroupViaInvite')[0]; @@ -39,7 +38,6 @@ exports.ExposeStore = (moduleRaidStr) => { window.Store.UserConstructor = window.mR.findModule((module) => (module.default && module.default.prototype && module.default.prototype.isServer && module.default.prototype.isUser) ? module.default : null)[0].default; window.Store.Validators = window.mR.findModule('findLinks')[0]; window.Store.VCard = window.mR.findModule('vcardFromContactModel')[0]; - window.Store.Wap = window.mR.findModule('queryLinkPreview')[0].default; window.Store.WidFactory = window.mR.findModule('createWid')[0]; window.Store.ProfilePic = window.mR.findModule('profilePicResync')[0]; window.Store.PresenceUtils = window.mR.findModule('sendPresenceAvailable')[0]; @@ -52,6 +50,7 @@ exports.ExposeStore = (moduleRaidStr) => { window.Store.sendReactionToMsg = window.mR.findModule('sendReactionToMsg')[0].sendReactionToMsg; window.Store.createOrUpdateReactionsModule = window.mR.findModule('createOrUpdateReactions')[0]; window.Store.EphemeralFields = window.mR.findModule('getEphemeralFields')[0]; + window.Store.ReplyUtils = window.mR.findModule('canReplyMsg').length > 0 && window.mR.findModule('canReplyMsg')[0]; window.Store.StickerTools = { ...window.mR.findModule('toWebpSticker')[0], ...window.mR.findModule('addWebpMetadata')[0] @@ -340,6 +339,19 @@ exports.ExposeStore = (moduleRaidStr) => { } return func(...args); }); + + // TODO remove these once everybody has been updated to WWebJS with legacy sessions removed + const _linkPreview = window.mR.findModule('queryLinkPreview'); + if (_linkPreview && _linkPreview[0] && _linkPreview[0].default) { + window.Store.Wap = _linkPreview[0].default; + } + + const _isMDBackend = window.mR.findModule('isMDBackend'); + if(_isMDBackend && _isMDBackend[0] && _isMDBackend[0].isMDBackend) { + window.Store.MDBackend = _isMDBackend[0].isMDBackend(); + } else { + window.Store.MDBackend = true; + } }; exports.LoadUtils = () => { @@ -440,7 +452,13 @@ exports.LoadUtils = () => { let quotedMsgOptions = {}; if (options.quotedMessageId) { let quotedMessage = window.Store.Msg.get(options.quotedMessageId); - if (quotedMessage.canReply()) { + + // TODO remove .canReply() once all clients are updated to >= v2.2241.6 + const canReply = window.Store.ReplyUtils ? + window.Store.ReplyUtils.canReplyMsg(quotedMessage.unsafe()) : + quotedMessage.canReply(); + + if (canReply) { quotedMsgOptions = quotedMessage.msgContextInfo(chat); } delete options.quotedMessageId; diff --git a/tests/client.js b/tests/client.js index 55f5334..0118c20 100644 --- a/tests/client.js +++ b/tests/client.js @@ -98,7 +98,7 @@ describe('Client', function() { await helper.sleep(20000); expect(callback.called).to.equal(true); - expect(callback.args[0][0]).to.have.lengthOf(152); + expect(callback.args[0][0]).to.have.length.greaterThanOrEqual(152); await client.destroy(); }); @@ -224,7 +224,7 @@ describe('Client', function() { expect(authFailCallback.called).to.equal(true); expect(qrCallback.called).to.equal(true); - expect(qrCallback.args[0][0]).to.have.lengthOf(152); + expect(qrCallback.args[0][0]).to.have.length.greaterThanOrEqual(152); await client.destroy(); }); @@ -346,7 +346,6 @@ describe('Client', function() { 'UserConstructor', 'VCard', 'Validators', - 'Wap', 'WidFactory', 'findCommonGroups', 'sendReactionToMsg', diff --git a/tests/structures/message.js b/tests/structures/message.js index 7a9749d..0f87e53 100644 --- a/tests/structures/message.js +++ b/tests/structures/message.js @@ -66,6 +66,8 @@ describe('Message', function () { expect(message.isStarred).to.equal(false); await message.star(); + await helper.sleep(1000); + // reload and check await message.reload(); expect(message.isStarred).to.equal(true); @@ -75,6 +77,8 @@ describe('Message', function () { expect(message.isStarred).to.equal(true); await message.unstar(); + await helper.sleep(1000); + // reload and check await message.reload(); expect(message.isStarred).to.equal(false); @@ -85,7 +89,7 @@ describe('Message', function () { it('can delete a message for me', async function () { await message.delete(); - await helper.sleep(1000); + await helper.sleep(5000); expect(await message.reload()).to.equal(null); }); diff --git a/tools/version-checker/.version b/tools/version-checker/.version index f3c9151..0b7f6f6 100644 --- a/tools/version-checker/.version +++ b/tools/version-checker/.version @@ -1 +1 @@ -2.2240.7 \ No newline at end of file +2.2241.6 \ No newline at end of file