sock.sendMessage with a few additional options.
WhatsApp IDs for broadcasts
Before sending, make sure you have the correct JID format for your target:Send a broadcast or Status update
Add thebroadcast, statusJidList, and optionally backgroundColor and font fields to the options object of sock.sendMessage.
statusJidList is required when publishing to status@broadcast. It determines which of your contacts can see the story. You must build and maintain this list yourself.Supported content types
The message body (the first argument after the JID) can be any of the following content types:
See the AnyRegularMessageContent type alias for the full list of supported content shapes, and MiscMessageGenerationOptions for all available send options.
Send to a broadcast list
You can send messages to a broadcast list the same way you send to an individual chat or group — just use the broadcast list’s JID as the target.Query a broadcast list’s name and recipients
Limitations
- Broadcast lists must be created in the WhatsApp mobile app first.
- Each broadcast list JID is derived from its creation timestamp, e.g.
1234567890123@broadcast. - Deleting a broadcast list through
chatModifyis supported, but creating one is not.