Wapi.js Docs / InteractiveMessage

Class: abstract InteractiveMessage

Represents an interactive message.

Implements

Abstract

Extends

  • BaseMessage<MessageTypeEnum.Interactive>

Extended by

Implements

Constructors

new InteractiveMessage()

new InteractiveMessage(params): InteractiveMessage

Creates an instance of 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

InteractiveMessage

Source

packages/wapi.js/src/structures/interaction/index.ts:47

Properties

interactiveMessageData

readonly interactiveMessageData: object

bodyText

bodyText: string

footerText?

optional footerText: string

optional header: object | object | object | object

type

type: InteractiveMessageTypeEnum

Implementation of

InteractiveMessageInterface.interactiveMessageData

Source

packages/wapi.js/src/structures/interaction/index.ts:31


messaging_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:17


recipient_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:18


type

type: MessageTypeEnum

The type of the message.

Implementation of

InteractiveMessageInterface.type

Inherited from

BaseMessage.type

Source

packages/wapi.js/src/structures/message/index.ts:16

Methods

parseConstructorPayload()

protected parseConstructorPayload(schema, payload): any

Parses the constructor payload using the provided schema.

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:42


toJson()

abstract toJson(params): object

Converts the message object to JSON format.

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?

optional biz_opaque_callback_data: string

context?

optional context: 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

Source

packages/wapi.js/src/structures/message/index.ts:25