TextMessageInterface
Wapi.js Docs / TextMessageInterface
Interface: TextMessageInterface
Represents the interface for a text message.
Interface
Extends
BaseMessageInterface
Properties
data
data:
object
The data property of the text message.
text
text:
null
|string
Source
packages/wapi.js/src/structures/text/interface.ts:14
messaging_product
messaging_product:
"whatsapp"
The messaging product.
Inherited from
BaseMessageInterface.messaging_product
Source
packages/wapi.js/src/structures/message/interface.ts:17
recipient_type
recipient_type:
"individual"
The recipient type.
Inherited from
BaseMessageInterface.recipient_type
Source
packages/wapi.js/src/structures/message/interface.ts:22
toJson()
toJson: (
params
) =>object
Converts the text message to a JSON object that can be sent as a request payload to the WhatsApp Cloud API.
Parameters
• params
The parameters for converting the text message to JSON.
• params.to: string
Returns
object
biz_opaque_callback_data?
optional
biz_opaque_callback_data:string
context?
optional
context:object
context.message_id
message_id:
string
messaging_product
messaging_product:
"whatsapp"
preview_url
preview_url:
boolean
recipient_type
recipient_type:
"individual"
text
text:
object
text.body
body:
string
text.preview_url?
optional
preview_url:boolean
to
to:
string
type
type:
Text
Source
packages/wapi.js/src/structures/text/interface.ts:21
type
type:
MessageTypeEnum
The type of the message.
Inherited from
BaseMessageInterface.type
Source
Was this page helpful?