wppconnect-team / wa-js

WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web
https://wppconnect.io/wa-js/
Apache License 2.0
435 stars 139 forks source link

Sending Message or Attachment to group chat isn't working #2533

Open mkamra2000 opened 2 days ago

mkamra2000 commented 2 days ago

WA-JS Version

3.15.1

WhatsApp Version

2.3000.1018445780

Browser Version

Chrome 131.0.6778.86

Operation System

Windows 11

Steps to reproduce

Run WPP.chat.sendTextMessage(chat.id.user, "Hi") with any group chat id

What is expected?

It should send message by running WPP.chat.sendTextMessage(chat.id.user, "Hi")

What is actually happening?

On running WPP.chat.sendTextMessage(chat.id.user, "Hi") Showing following error:- image

Any additional comments?

Although it's working perfectly, if we are using serialized id chat.id._serialized

ariona commented 1 day ago

First parameter should be in format id@c.us or id@g.us for group or you can use _serialized property.

WPP.chat.sendTextMessage(chat.id._serialized, "Hi")
mkamra2000 commented 23 hours ago

Yeah, using the _serialized ID is working properly.

However, in the codebase, I was previously using chat.id.user, and it worked fine at that time. Do I need to update the implementation to use _serialized IDs now?

Have we updated this recently?

ariona commented 23 hours ago

If i am not mistaken it always like that, because it need to determine which server (@c.us/@g.us) it need to be sent to.