Webwhatsapp-wrapper: window.WAPI.sendImage not working again

Created on 16 Feb 2020  Â·  10Comments  Â·  Source: mukulhase/WebWhatsapp-Wrapper

I tried wapi.js and found window.WAPI.sendImage has not worked again.

Most helpful comment

I've got a solution... You need to change this code

{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processFiles !== undefined) ? module.default : null },

to this code

{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processAttachments) ? module.default : null },

And then you need to change this code too

mc.processFiles([mediaBlob], chat, 1).then(() => {
    var media = mc.models[0];
    media.sendToChat(chat, { caption: caption });
    if (done !== undefined) done(true);
});

to this code

mc.processAttachments([{file: mediaBlob}, 1], chat, 1).then(() => {
    let media = mc.models[0];
    media.sendToChat(chat, {caption:caption});
    if (done !== undefined) done(true);
});

All 10 comments

try #809

I also have problem.
It returns an error on console saying :

Error: Evaluation failed: TypeError: Cannot read property 'match' of undefined
    at new e (https://web.whatsapp.com/app.389d6565f1dd26f59e83.js:2:3507877)

The error occur here: var idUser = new window.Store.UserConstructor(chatid, { intentionallyUsePrivateConstructor: true });

try #809

It doesn't work...

After WhatsApp version 0.4.930 update, the sendImage is not working. It seems that they remove the Store.MediaCollection.

P {_flags: 6, _value: TypeError: Store.MediaCollection is not a constructor
    at <anonymous>:1221:14
    at oe (https:/…, _onRejected: undefined, _context: undefined, _onFulfilled: ƒ, …}

I've got a solution... You need to change this code

{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processFiles !== undefined) ? module.default : null },

to this code

{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processAttachments) ? module.default : null },

And then you need to change this code too

mc.processFiles([mediaBlob], chat, 1).then(() => {
    var media = mc.models[0];
    media.sendToChat(chat, { caption: caption });
    if (done !== undefined) done(true);
});

to this code

mc.processAttachments([{file: mediaBlob}, 1], chat, 1).then(() => {
    let media = mc.models[0];
    media.sendToChat(chat, {caption:caption});
    if (done !== undefined) done(true);
});

I've got a solution... You need to change this code

{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processFiles !== undefined) ? module.default : null },

to this code

{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processAttachments) ? module.default : null },

And then you need to change this code too

mc.processFiles([mediaBlob], chat, 1).then(() => {
    var media = mc.models[0];
    media.sendToChat(chat, { caption: caption });
    if (done !== undefined) done(true);
});

to this code

mc.processAttachments([{file: mediaBlob}, 1], chat, 1).then(() => {
    let media = mc.models[0];
    media.sendToChat(chat, {caption:caption});
    if (done !== undefined) done(true);
});

What version of your WhatsApp Web? On 0.4.930 still doesn't work.

I've got a solution... You need to change this code

{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processFiles !== undefined) ? module.default : null },

to this code

{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processAttachments) ? module.default : null },

And then you need to change this code too

mc.processFiles([mediaBlob], chat, 1).then(() => {
    var media = mc.models[0];
    media.sendToChat(chat, { caption: caption });
    if (done !== undefined) done(true);
});

to this code

mc.processAttachments([{file: mediaBlob}, 1], chat, 1).then(() => {
    let media = mc.models[0];
    media.sendToChat(chat, {caption:caption});
    if (done !== undefined) done(true);
});

What version of your WhatsApp Web? On 0.4.930 still doesn't work.

Have you done with this one? #810

I've got a solution... You need to change this code

```
{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processFiles !== undefined) ? module.default : null },

to this code





  ```
{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processAttachments) ? module.default : null },

And then you need to change this code too

```
mc.processFiles([mediaBlob], chat, 1).then(() => {
var media = mc.models[0];
media.sendToChat(chat, { caption: caption });
if (done !== undefined) done(true);
});

to this code





  ```
mc.processAttachments([{file: mediaBlob}, 1], chat, 1).then(() => {
    let media = mc.models[0];
    media.sendToChat(chat, {caption:caption});
    if (done !== undefined) done(true);
});

What version of your WhatsApp Web? On 0.4.930 still doesn't work.

Have you done with this one? #810

Yes.

I've got a solution... You need to change this code

{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processFiles !== undefined) ? module.default : null },

to this code

{ id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processAttachments) ? module.default : null },

And then you need to change this code too

mc.processFiles([mediaBlob], chat, 1).then(() => {
    var media = mc.models[0];
    media.sendToChat(chat, { caption: caption });
    if (done !== undefined) done(true);
});

to this code

mc.processAttachments([{file: mediaBlob}, 1], chat, 1).then(() => {
    let media = mc.models[0];
    media.sendToChat(chat, {caption:caption});
    if (done !== undefined) done(true);
});

Worked now, thanks for the answer!!

Worked for me!! Tks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

drsoporte picture drsoporte  Â·  5Comments

juancrescente picture juancrescente  Â·  4Comments

dmreinoso picture dmreinoso  Â·  3Comments

mhndm picture mhndm  Â·  3Comments

ItachiL18 picture ItachiL18  Â·  6Comments