From d1c762c5e167e5c5495fa6f65cfe2da6420cb203 Mon Sep 17 00:00:00 2001 From: Arpit Vasani Date: Mon, 28 Sep 2020 23:53:06 +0530 Subject: [PATCH] Updated WAPI to support the latest Whatsapp update --- package.json | 2 +- src/WAPI.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 63308ea..abbc4bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wbot", - "version": "0.13.0", + "version": "0.13.1", "description": "A simple whatsapp reply bot using puppeteer.", "main": "src/index.js", "scripts": { diff --git a/src/WAPI.js b/src/WAPI.js index 15dec23..5bc7600 100644 --- a/src/WAPI.js +++ b/src/WAPI.js @@ -41,7 +41,7 @@ if (!window.Store||!window.Store.Msg) { { id: "addAndSendMsgToChat", conditions: (module) => (module.addAndSendMsgToChat) ? module.addAndSendMsgToChat : null }, { id: "sendMsgToChat", conditions: (module) => (module.sendMsgToChat) ? module.sendMsgToChat : null }, { id: "Catalog", conditions: (module) => (module.Catalog) ? module.Catalog : null }, - { id: "bp", conditions: (module) => (module.default&&module.default.toString().includes('bp_unknown_version')) ? module.default : null }, + { id: 'Perfil',conditions: (module) => module.__esModule === true && module.setPushname && !module.getComposeContents? module : null}, { id: "MsgKey", conditions: (module) => (module.default&&module.default.toString().includes('MsgKey error: obj is null/undefined')) ? module.default : null }, { id: "Parser", conditions: (module) => (module.convertToTextWithoutSpecialEmojis) ? module.default : null }, { id: "Builders", conditions: (module) => (module.TemplateMessage && module.HydratedFourRowTemplate) ? module : null }, @@ -1510,8 +1510,7 @@ window.WAPI.sendImage = async function (imgBase64, chatid, filename, caption, qu * @param newName - string the new name to set as profile name */ window.WAPI.setMyName = async function (newName) { - if(!Store.Versions.default[11].BinaryProtocol) Store.Versions.default[11].BinaryProtocol=new Store.bp(11); - return await Store.Versions.default[11].setPushname(newName); + return await window.Store.Perfil.setPushname(newName); } /** Change the icon for the group chat