BaseMessage
<MessageTypeEnum.Image
>new ImageMessage(Creates a new instance of the ImageMessage class.params
):ImageMessage
object
| object
The parameters to initialize the image message.
ImageMessage
BaseMessage<MessageTypeEnum.Image>.constructor
data:object
|object
ImageMessageInterface
.data
messaging_product: "whatsapp"
The messaging product.
ImageMessageInterface
.messaging_product
BaseMessage.messaging_product
recipient_type: "individual"
The recipient type.
ImageMessageInterface
.recipient_type
BaseMessage.recipient_type
type: MessageTypeEnum
The type of the message.
ImageMessageInterface
.type
BaseMessage.type
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 image message to the WhatsApp Cloud API payload.params
):object
string
The ID of the message being replied to.
• params.to: string
The recipient of the message.
object
optional
biz_opaque_callback_data:string
optional
context:object
message_id: string
image:object
|object
messaging_product: "whatsapp"
recipient_type: "individual"
to: string
type: Image
BaseMessage.toJson