pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.05k stars 3.58k forks source link

window.mR.findModule('findChat')[0]; returns undefined #3195

Open andrew-quicklution opened 2 months ago

andrew-quicklution commented 2 months ago

Is there an existing issue for this?

Describe the bug

The findChat function is no longer available. the above code returns undefined. Hence chats cannot be found and messages be sent

Expected behavior

returns the findChat function

Steps to Reproduce the Bug or Issue

window.Store.FindChat = window.mR.findModule('findChat')[0]; in inject.js

Relevant Code

No response

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

No, I am not using Multi Device

Environment

Windows OS Phone iOS WhatsApp Web Version: 2.3000.1014839084

Additional context

No response

MoudiZd commented 2 months ago

Replace findChat by findExistingChat must solve this

To become like this :

window.Store.FindChat = window.mR.findModule('findExistingChat')[0];

Now the module WAWebFindChatAction no longer contain findChat method but instead findExistingChat

And each place you are using window.Store.FindChat.findChat replace it by window.Store.FindChat.findExistingChat