BaseMessage
<"contacts"
>new ContactMessage(Creates a new ContactMessage instance.params
):ContactMessage
Contact
[]
The contacts in the message.
ContactMessage
BaseMessage<"contacts">.constructor
contacts: Contact
[]
An array of contacts associated with the message.
ContactMessageInterface
.contacts
messaging_product: "whatsapp"
The messaging product.
ContactMessageInterface
.messaging_product
BaseMessage.messaging_product
recipient_type: "individual"
The recipient type.
ContactMessageInterface
.recipient_type
BaseMessage.recipient_type
type: MessageTypeEnum
The type of the message.
ContactMessageInterface
.type
BaseMessage.type
addContact(Adds a contact to the message.contact
):void
Contact
The contact to add to the message.
void
Parses the constructor payload using the provided schema.protected
parseConstructorPayload(schema
,payload
):any
ZodType
<any
, ZodTypeDef
, any
>
The Zod schema used for parsing the payload.
• payload: any
The payload to be parsed.
any
The parsed data.
BaseMessage.parseConstructorPayload
toJson(Converts the ContactMessage instance to a JSON object.params
):object
string
The ID of the message to reply to.
• params.to: string
The recipient of the message.
object
optional
biz_opaque_callback_data:string
contacts: object
[]
optional
context:object
message_id: string
messaging_product: "whatsapp"
recipient_type: "individual"
to: string
type: Contacts
BaseMessage.toJson