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.18k stars 3.62k forks source link

Webpack exodus fix getMessageById exception handling #3239

Closed pedro-php closed 1 month ago

pedro-php commented 1 month ago

PR Details

Updates client.js to handle Group Messages with invalid wids.

Description

GetMessageBy id throws an error when the number of parameters of the message ID after splitting it's "_" it's different from 3. Example: fromMe_sender@c.us_messageId.
However, group messages have 4 parameters, so it throws an exception when it receives it: Example: fromMe_idGroup@g.us_messageId_sender@c.us . So i fixed it in order to allow 4 parameters without throwing the error.

Types of changes

Checklist

alechkos commented 1 month ago

webpack-exodus was merge into main