-

npm Depfu WhatsApp_Web 2.2241.6 Discord Chat

+

npm Depfu WhatsApp_Web 2.2245.9 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 df20a92..3f8c6f8 100644 --- a/docs/structures_Base.js.html +++ b/docs/structures_Base.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/Base.js + whatsapp-web.js 1.18.4 » 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 90aaecc..1107174 100644 --- a/docs/structures_BusinessContact.js.html +++ b/docs/structures_BusinessContact.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/BusinessContact.js + whatsapp-web.js 1.18.4 » 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 4699fde..62185c1 100644 --- a/docs/structures_Buttons.js.html +++ b/docs/structures_Buttons.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/Buttons.js + whatsapp-web.js 1.18.4 » 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 2118c5d..b67cda9 100644 --- a/docs/structures_Call.js.html +++ b/docs/structures_Call.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/Call.js + whatsapp-web.js 1.18.4 » 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 96fe03d..e2f7f71 100644 --- a/docs/structures_Chat.js.html +++ b/docs/structures_Chat.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/Chat.js + whatsapp-web.js 1.18.4 » 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 71f9642..a538650 100644 --- a/docs/structures_ClientInfo.js.html +++ b/docs/structures_ClientInfo.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/ClientInfo.js + whatsapp-web.js 1.18.4 » 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 39cbc5f..7ad3563 100644 --- a/docs/structures_Contact.js.html +++ b/docs/structures_Contact.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/Contact.js + whatsapp-web.js 1.18.4 » 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 1faee56..bf4daa9 100644 --- a/docs/structures_GroupChat.js.html +++ b/docs/structures_GroupChat.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/GroupChat.js + whatsapp-web.js 1.18.4 » 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 2941245..c3e48c5 100644 --- a/docs/structures_GroupNotification.js.html +++ b/docs/structures_GroupNotification.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/GroupNotification.js + whatsapp-web.js 1.18.4 » 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 5fc785d..750c011 100644 --- a/docs/structures_Label.js.html +++ b/docs/structures_Label.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/Label.js + whatsapp-web.js 1.18.4 » 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 0e2c027..61531b6 100644 --- a/docs/structures_List.js.html +++ b/docs/structures_List.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/List.js + whatsapp-web.js 1.18.4 » 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 353d381..a161277 100644 --- a/docs/structures_Location.js.html +++ b/docs/structures_Location.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/Location.js + whatsapp-web.js 1.18.4 » 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 259bc90..adc947b 100644 --- a/docs/structures_Message.js.html +++ b/docs/structures_Message.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/Message.js + whatsapp-web.js 1.18.4 » Source: structures/Message.js @@ -15,7 +15,7 @@ @@ -336,8 +336,9 @@ class Message extends Base { if (!this.hasQuotedMsg) return undefined; const quotedMsg = await this.client.pupPage.evaluate((msgId) => { - let msg = window.Store.Msg.get(msgId); - return msg.quotedMsgObj().serialize(); + const msg = window.Store.Msg.get(msgId); + const quotedMsg = window.Store.QuotedMsg.getQuotedMsgObj(msg); + return window.WWebJS.getMessageModel(quotedMsg); }, this.id._serialized); return new Message(this.client, quotedMsg); @@ -467,7 +468,8 @@ class Message extends Base { await this.client.pupPage.evaluate((msgId, everyone) => { let msg = window.Store.Msg.get(msgId); - if (everyone && msg._canRevoke()) { + const canRevoke = window.Store.MsgActionChecks.canSenderRevokeMsg(msg) || window.Store.MsgActionChecks.canAdminRevokeMsg(msg); + if (everyone && canRevoke) { return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], { type: msg.id.fromMe ? 'Sender' : 'Admin' }); } @@ -482,7 +484,7 @@ class Message extends Base { await this.client.pupPage.evaluate((msgId) => { let msg = window.Store.Msg.get(msgId); - if (msg.canStar()) { + if (window.Store.MsgActionChecks.canStarMsg(msg)) { return window.Store.Cmd.sendStarMsgs(msg.chat, [msg], false); } }, this.id._serialized); @@ -495,7 +497,7 @@ class Message extends Base { await this.client.pupPage.evaluate((msgId) => { let msg = window.Store.Msg.get(msgId); - if (msg.canStar()) { + if (window.Store.MsgActionChecks.canStarMsg(msg)) { return window.Store.Cmd.sendUnstarMsgs(msg.chat, [msg], false); } }, this.id._serialized); @@ -569,7 +571,7 @@ module.exports = Message;
diff --git a/docs/structures_MessageMedia.js.html b/docs/structures_MessageMedia.js.html index 1c3f7aa..7518e5a 100644 --- a/docs/structures_MessageMedia.js.html +++ b/docs/structures_MessageMedia.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/MessageMedia.js + whatsapp-web.js 1.18.4 » 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 313a26f..191f812 100644 --- a/docs/structures_Order.js.html +++ b/docs/structures_Order.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/Order.js + whatsapp-web.js 1.18.4 » 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 a4f19c6..b118b40 100644 --- a/docs/structures_Payment.js.html +++ b/docs/structures_Payment.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/Payment.js + whatsapp-web.js 1.18.4 » 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 3d1b457..72c40a2 100644 --- a/docs/structures_PrivateChat.js.html +++ b/docs/structures_PrivateChat.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/PrivateChat.js + whatsapp-web.js 1.18.4 » 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 8e24243..c072878 100644 --- a/docs/structures_PrivateContact.js.html +++ b/docs/structures_PrivateContact.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/PrivateContact.js + whatsapp-web.js 1.18.4 » 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 b3d345e..202d07e 100644 --- a/docs/structures_Product.js.html +++ b/docs/structures_Product.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/Product.js + whatsapp-web.js 1.18.4 » 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 f4b68e2..730925a 100644 --- a/docs/structures_ProductMetadata.js.html +++ b/docs/structures_ProductMetadata.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/ProductMetadata.js + whatsapp-web.js 1.18.4 » 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 2efca66..2308bab 100644 --- a/docs/structures_Reaction.js.html +++ b/docs/structures_Reaction.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: structures/Reaction.js + whatsapp-web.js 1.18.4 » 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 1169b26..ffc1ef9 100644 --- a/docs/util_Constants.js.html +++ b/docs/util_Constants.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: util/Constants.js + whatsapp-web.js 1.18.4 » 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 d034985..2d18f56 100644 --- a/docs/util_InterfaceController.js.html +++ b/docs/util_InterfaceController.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: util/InterfaceController.js + whatsapp-web.js 1.18.4 » 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 a21b145..a35663a 100644 --- a/docs/util_Util.js.html +++ b/docs/util_Util.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 1.18.2 » Source: util/Util.js + whatsapp-web.js 1.18.4 » Source: util/Util.js @@ -15,7 +15,7 @@ @@ -225,7 +225,7 @@ module.exports = Util;
diff --git a/index.d.ts b/index.d.ts index 39c12d1..e7a8500 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1326,6 +1326,9 @@ declare namespace WAWebJS { webClientShouldHandle: boolean, /** Object with participants */ participants: object + + /** Reject the call */ + reject: () => Promise } /** Message type List */ diff --git a/package.json b/package.json index 90094ea..450d31f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "whatsapp-web.js", - "version": "1.18.2", + "version": "1.18.4", "description": "Library for interacting with the WhatsApp Web API ", "main": "./index.js", "typings": "./index.d.ts", diff --git a/src/structures/Call.js b/src/structures/Call.js index 1e6644d..0e48989 100644 --- a/src/structures/Call.js +++ b/src/structures/Call.js @@ -62,7 +62,15 @@ class Call extends Base { return super._patch(data); } - + + /** + * Reject the call + */ + async reject() { + return this.client.pupPage.evaluate((peerJid, id) => { + return window.WWebJS.rejectCall(peerJid, id); + }, this.from, this.id); + } } module.exports = Call; \ No newline at end of file diff --git a/src/structures/Message.js b/src/structures/Message.js index e8260dd..ee79c20 100644 --- a/src/structures/Message.js +++ b/src/structures/Message.js @@ -305,8 +305,9 @@ class Message extends Base { if (!this.hasQuotedMsg) return undefined; const quotedMsg = await this.client.pupPage.evaluate((msgId) => { - let msg = window.Store.Msg.get(msgId); - return msg.quotedMsgObj().serialize(); + const msg = window.Store.Msg.get(msgId); + const quotedMsg = window.Store.QuotedMsg.getQuotedMsgObj(msg); + return window.WWebJS.getMessageModel(quotedMsg); }, this.id._serialized); return new Message(this.client, quotedMsg); @@ -436,7 +437,8 @@ class Message extends Base { await this.client.pupPage.evaluate((msgId, everyone) => { let msg = window.Store.Msg.get(msgId); - if (everyone && msg._canRevoke()) { + const canRevoke = window.Store.MsgActionChecks.canSenderRevokeMsg(msg) || window.Store.MsgActionChecks.canAdminRevokeMsg(msg); + if (everyone && canRevoke) { return window.Store.Cmd.sendRevokeMsgs(msg.chat, [msg], { type: msg.id.fromMe ? 'Sender' : 'Admin' }); } @@ -451,7 +453,7 @@ class Message extends Base { await this.client.pupPage.evaluate((msgId) => { let msg = window.Store.Msg.get(msgId); - if (msg.canStar()) { + if (window.Store.MsgActionChecks.canStarMsg(msg)) { return window.Store.Cmd.sendStarMsgs(msg.chat, [msg], false); } }, this.id._serialized); @@ -464,7 +466,7 @@ class Message extends Base { await this.client.pupPage.evaluate((msgId) => { let msg = window.Store.Msg.get(msgId); - if (msg.canStar()) { + if (window.Store.MsgActionChecks.canStarMsg(msg)) { return window.Store.Cmd.sendUnstarMsgs(msg.chat, [msg], false); } }, this.id._serialized); diff --git a/src/util/Injected.js b/src/util/Injected.js index c513373..a0a7b12 100644 --- a/src/util/Injected.js +++ b/src/util/Injected.js @@ -14,7 +14,7 @@ exports.ExposeStore = (moduleRaidStr) => { window.Store.CryptoLib = window.mR.findModule('decryptE2EMedia')[0]; window.Store.DownloadManager = window.mR.findModule('downloadManager')[0].downloadManager; 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.GroupMetadata = window.mR.findModule('GroupMetadata')[0].default.GroupMetadata; window.Store.Invite = window.mR.findModule('sendJoinGroupViaInvite')[0]; window.Store.InviteInfo = window.mR.findModule('sendQueryGroupInvite')[0]; window.Store.Label = window.mR.findModule('LabelCollection')[0].LabelCollection; @@ -51,6 +51,10 @@ exports.ExposeStore = (moduleRaidStr) => { 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.MsgActionChecks = window.mR.findModule('canSenderRevokeMsg')[0]; + window.Store.QuotedMsg = window.mR.findModule('getQuotedMsgObj')[0]; + window.Store.Socket = window.mR.findModule('deprecatedSendIq')[0]; + window.Store.SocketWap = window.mR.findModule('wap')[0]; window.Store.StickerTools = { ...window.mR.findModule('toWebpSticker')[0], ...window.mR.findModule('addWebpMetadata')[0] @@ -600,4 +604,21 @@ exports.LoadUtils = () => { return undefined; }; + + window.WWebJS.rejectCall = async (peerJid, id) => { + peerJid = peerJid.split('@')[0] + '@s.whatsapp.net'; + let userId = window.Store.User.getMaybeMeUser().user + '@s.whatsapp.net'; + const stanza = window.Store.SocketWap.wap('call', { + id: window.Store.SocketWap.generateId(), + from: window.Store.SocketWap.USER_JID(userId), + to: window.Store.SocketWap.USER_JID(peerJid), + }, [ + window.Store.SocketWap.wap('reject', { + 'call-id': id, + 'call-creator': window.Store.SocketWap.USER_JID(peerJid), + count: '0', + }) + ]); + await window.Store.Socket.deprecatedCastStanza(stanza); + }; }; diff --git a/tools/version-checker/.version b/tools/version-checker/.version index 0b7f6f6..53ab36c 100644 --- a/tools/version-checker/.version +++ b/tools/version-checker/.version @@ -1 +1 @@ -2.2241.6 \ No newline at end of file +2.2245.9 \ No newline at end of file