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
14.62k stars 3.48k forks source link

UnhandledPromiseRejectionWarning: Error: Evaluation failed: u #2002

Closed allail-qadrillah closed 7 months ago

allail-qadrillah commented 1 year ago

Is there an existing issue for this?

Describe the bug

when i try to send an audio from a local file, it doesn't works

Expected behavior

Send messages with audio files

Steps to Reproduce the Bug or Issue

trying to send .mp3 file messages

Relevant Code

const media = await MessageMedia.fromFilePath("Voice.mp3")
await client.sendMessage(msg.from, media)

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

OS: Windows 10 Pro Phone OS: Android whatsapp-web.js V. 1.19.4 WhatsApp Web V. 2.2224.8 Node.js V. 16.15.1

Additional context

No response

amosayomide05 commented 1 year ago

same here

hermanigoncalves commented 1 year ago

the same but with buttons

PurpShell commented 1 year ago

the same but with buttons

you can't send audio with buttons. You really can't, as in the code itself allows for button message headers with attachments and not audio.

hermanigoncalves commented 1 year ago

I'm not trying to send audio in the header of the buttons. And yes only the buttons and when I install the solution given in another topic of the error: IMG_20230215_160038.jpg

amosayomide05 commented 1 year ago

the same but with buttons

you can't send audio with buttons. You really can't, as in the code itself allows for button message headers with attachments and not audio.

Without buttons

llantasghasham commented 1 year ago

i have the the saas type web page installed and configurate in my url I want to implement the script chatwoot to the page to be able to rent it gz i dont see the create a new acount , can you do it qith the logo and name change my whatsapp +50687021496

alechkos commented 7 months ago
const media = MessageMedia.fromFilePath('path/to/file.extension');
await client.sendMessage(msg.from, media);