tulir / whatsmeow

Go library for the WhatsApp web multidevice API
https://go.mau.fi/whatsmeow
Mozilla Public License 2.0
1.96k stars 368 forks source link

Sending messages to hidden users (HiddenUserServer) #473

Open poislagarde opened 9 months ago

poislagarde commented 9 months ago

WhatsApp sometimes hides the phone number when a user opens a chat with a business for the first time:

You can start a WhatsApp chat directly with a business through ads on Facebook and Instagram. In some cases, when you open a chat with a business for the first time, your phone number will be hidden from them by default for your privacy. This means that the business can’t see your phone number or call you at your phone number unless you choose to share it. When phone number hiding is enabled, you will see a system message alerting you of this in the chat.

Source: https://faq.whatsapp.com/626403979060997/?helpref=uf_share

The JID of these chats ends with @lid (the HiddenUserServer server).

Problem

I get the following error when trying to reply to one of these chats using Client.SendMessage:

can't send message to unknown server lid

ezesculli commented 9 months ago

Same thing here! Any fix for this?

HermesMacedo commented 6 months ago

This error. It's happening here too.

Any solution?

mamur-rezeki commented 6 months ago

Hidden chat server isn't implemented yet.

https://github.com/tulir/whatsmeow/blob/main/send.go#L194-L204

david-botelho-mariano commented 4 months ago

My error was: Error sending message: failed to get device list: unknown user server 'lid'

And I fixed by restarting the entire program.