mukulhase / WebWhatsapp-Wrapper

An API for sending and receiving messages over web.whatsapp [Working as of 18th May 2018]
https://webwhatsapi.readthedocs.io/en/latest/
MIT License
2.03k stars 795 forks source link

WAPI.sendImage not working #833

Open mikelustosa opened 4 years ago

mikelustosa commented 4 years ago

TypeError: Store.MediaCollection is not a constructor

victoralvesf commented 4 years ago

Try: #829

mikelustosa commented 4 years ago

Thanks, this work.

catur515 commented 4 years ago

Thanks.. its work again..

gugaevkirill commented 4 years ago

It still doesn't work for me 😕 on 0.4.930

I've changed code to this, but have no result:

function getStore(modules) {
            let foundCount = 0;
            let neededObjects = [
                { id: "Store", conditions: (module) => (module.Chat && module.Msg) ? module : null },
                { id: "MediaCollection", conditions: (module) => (module.default && module.default.prototype && module.default.prototype.processAttachments) ? module.default : null },

and

    let mediaBlob = Store.MediaProcess.urlToFile(imageUrl);
    const mc = new Store.MediaCollection(chat);

    mc.processAttachments([{file: mediaBlob}], chat, 1).then(() => {
        let media = mc.models[0];

        media.sendToChat(chat, { caption: caption });

Surprisingly, this code helps to send file to chat, but images still not working

catur515 commented 4 years ago

still working until now

gugaevkirill commented 4 years ago

I've got

"InvalidMediaFileType: ExtendableError
    at t.n (https://web.whatsapp.com/app.a6bc2c573f664d4f1feb.js:2:961989)
    at new t (https://web.whatsapp.com/app.a6bc2c573f664d4f1feb.js:2:356557)
    at https://web.whatsapp.com/app2.f3de4b25fd081b1d310c.js:2:480697
    at oe (https://web.whatsapp.com/app.a6bc2c573f664d4f1feb.js:2:15063)
    at MutationObserver.ae (https://web.whatsapp.com/app.a6bc2c573f664d4f1feb.js:2:14564)"

at mc.models[0].__x_exception.stack after processing attachments

And I dont send images using base64. I use:

let mediaBlob = Store.MediaProcess.urlToFile(imageUrl);
booysej commented 4 years ago

Both sending of images and text seems to be broken now on my side

Meet2308 commented 4 years ago

@booysej what's issue? working fine for me

booysej commented 4 years ago

Applied fix, working again https://github.com/mukulhase/WebWhatsapp-Wrapper/pull/830/commits

3dluis commented 4 years ago

After the change, it takes a long time to send the image.

booysej commented 4 years ago

I found If I send large images or videos i sends quick at first, but after I send a few in a short period of time it gets stuck or takes very long to send

On Sat, Mar 7, 2020 at 8:53 PM Luis Daniel notifications@github.com wrote:

After the change, it takes a long time to send the image.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mukulhase/WebWhatsapp-Wrapper/issues/833?email_source=notifications&email_token=AAN26IB6PMPX57CWXQEMFM3RGKJ4BA5CNFSM4KXWU6U2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEOECYCI#issuecomment-596126729, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN26ID5S3HCOT7P5P4M2GLRGKJ4BANCNFSM4KXWU6UQ .

3dluis commented 4 years ago

Some solutions for this?

3dluis commented 4 years ago

The request to send images remains on hold without response.

booysej commented 4 years ago

It works for me, just apply the patch as per above

On Mon, Mar 16, 2020 at 4:12 PM Luis Daniel notifications@github.com wrote:

The request to send images remains on hold without response.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mukulhase/WebWhatsapp-Wrapper/issues/833#issuecomment-599558219, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN26IGU4FPIS3Z4AQOVFO3RHYXUZANCNFSM4KXWU6UQ .

gresaggr commented 4 years ago

Hello. Sending images doesn't work now. Is it possible to fix it?