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

mp3 send error #2630

Closed ISURU11221 closed 9 months ago

ISURU11221 commented 10 months ago

Is there an existing issue for this?

Describe the bug

this is for sending mp3 error . it's not for sending Doucment type audio files . tried to many ways to send audio file , but not working . Have any way to send it .Please regard to me .

throw new Error('Evaluation failed: ' + helper_js_1.helper.getExceptionMessage(exceptionDetails));
                  ^

Error: Evaluation failed: u
    at ExecutionContext._evaluateInternal (C:\Users\HP\Desktop\whatsappbot\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:221:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ExecutionContext.evaluate (C:\Users\HP\Desktop\whatsappbot\node_modules\puppeteer\lib\cjs\puppeteer\common\ExecutionContext.js:110:16)
    at async Client.sendMessage (C:\Users\HP\Desktop\whatsappbot\node_modules\whatsapp-web.js\src\Client.js:888:28)

Node.js v18.17.0

i got it for this code -


console.log('Client is ready!');
        const chatId = '94764341089@c.us';
        const media = MessageMedia.fromFilePath('./test.mp3');
        msg.reply(media).then(ack => {
            if(ack.id._serialized){
                console.log('MP3 send Successfully');
            }else {
                console.log('MP3 not send');
            }

```})

**please help to solve this**

### Expected behavior

error

### Steps to Reproduce the Bug or Issue

error

### Relevant Code

_No response_

### Browser Type

Google Chrome

### WhatsApp Account Type

Standard

### Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

### Environment

windows 10,
latest vs code,
node v18.17

### Additional context

_No response_
sadmantm commented 10 months ago

I also have this error, fix it!

alechkos commented 9 months ago

The media message is being sent propely, the issue is with your code, also check the media message handling