Class: abstract InteractiveMessage
Represents an interactive message.
Implements
Abstract
Extends
BaseMessage<MessageTypeEnum.Interactive>
Extended by
Implements
Constructors
new InteractiveMessage()
new InteractiveMessage(Creates an instance of InteractiveMessage.params):InteractiveMessage
Parameters
• params The parameters for creating the interactive message. • params.bodyText:string
The body text of the interactive message.
• params.footerText?: string
The footer text of the interactive message.
• params.type: InteractiveMessageTypeEnum
The type of the interactive message.
Returns
InteractiveMessage
Overrides
BaseMessage<MessageTypeEnum.Interactive>.constructor
Memberof
InteractiveMessageSource
packages/wapi.js/src/structures/interaction/index.ts:47Properties
interactiveMessageData
readonlyinteractiveMessageData:object
bodyText
bodyText: string
footerText?
optionalfooterText:string
header?
optionalheader:object|object|object|object
type
type: InteractiveMessageTypeEnum
Implementation of
InteractiveMessageInterface.interactiveMessageData
Source
packages/wapi.js/src/structures/interaction/index.ts:31messaging_product
messaging_product: "whatsapp"
The messaging product.
Implementation of
InteractiveMessageInterface.messaging_product
Inherited from
BaseMessage.messaging_product
Source
packages/wapi.js/src/structures/message/index.ts:17recipient_type
recipient_type: "individual"
The recipient type.
Implementation of
InteractiveMessageInterface.recipient_type
Inherited from
BaseMessage.recipient_type
Source
packages/wapi.js/src/structures/message/index.ts:18type
type: MessageTypeEnum
The type of the message.
Implementation of
InteractiveMessageInterface.type
Inherited from
BaseMessage.type
Source
packages/wapi.js/src/structures/message/index.ts:16Methods
parseConstructorPayload()
Parses the constructor payload using the provided schema.protectedparseConstructorPayload(schema,payload):any
Parameters
• schema:ZodType<any, ZodTypeDef, any>
The Zod schema used for parsing the payload.
• payload: any
The payload to be parsed.
Returns
any
The parsed data.
Inherited from
BaseMessage.parseConstructorPayload
Throws
An error if the parsing fails.Source
packages/wapi.js/src/structures/message/index.ts:42toJson()
Converts the message object to JSON format.abstracttoJson(params):object
Parameters
• params The parameters required for converting the message to JSON. • params.replyToMessageId?:string
• params.to: string
Returns
object
The JSON representation of the message.
biz_opaque_callback_data?
optionalbiz_opaque_callback_data:string
context?
optionalcontext:object
context.message_id
message_id: string
interactive
interactive:object|object|object|object|object|object
messaging_product
messaging_product: "whatsapp"
recipient_type
recipient_type: "individual"
to
to: string
type
type: Interactive
Inherited from
BaseMessage.toJson