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.96k stars 3.55k forks source link

Receive message with emoticons end with error #662

Closed dickymuliafiqri closed 3 years ago

dickymuliafiqri commented 3 years ago

Bug description

There's is an error when my bot receive message with emoji.

Reproduction steps

Steps to reproduce the behavior:

  1. Just send message with emoji, ex = "Hello ♥️"

Environment (please complete the following information):

WhatsApp

Library

Additional context

Here is the log

Pesan diterima: Halo 😇 (node:8583) UnhandledPromiseRejectionWarning: TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters at new ClientRequest (_http_client.js:148:13) at request (https.js:314:10) at /home/dickymuliafiqri/Documents/WABOT/node_modules/node-fetch/lib/index.js:1438:15 at new Promise () at fetch (/home/dickymuliafiqri/Documents/WABOT/node_modules/node-fetch/lib/index.js:1407:9) at chatStatus (/home/dickymuliafiqri/Documents/WABOT/app.js:59:30) at Client. (/home/dickymuliafiqri/Documents/WABOT/app.js:90:9) at Client.emit (events.js:315:20) at /home/dickymuliafiqri/Documents/WABOT/node_modules/whatsapp-web.js/src/Client.js:238:18 at Page._onBindingCalled (/home/dickymuliafiqri/Documents/WABOT/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:717:62) (node:8583) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2) (node:8583) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

pedroslopez commented 3 years ago

Tested this and it's working fine on my end. Seems like the issue may be in your code, potentially sending emojis directly in URLs from what I can tell in TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters

dickymuliafiqri commented 3 years ago

Yes, the problem is fixed.

Thanks...