Skip to content

Commit

Permalink
Updated WAPI to support the latest Whatsapp update
Browse files Browse the repository at this point in the history
  • Loading branch information
vasani-arpit committed Sep 28, 2020
1 parent 13234f4 commit d1c762c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
5 changes: 2 additions & 3 deletions src/WAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d1c762c

Please sign in to comment.