ButtonInteractionMessage
Wapi.js Docs / ButtonInteractionMessage
Class: ButtonInteractionMessage
Represents a button interaction message.
Implements
Extends
Implements
Constructors
new ButtonInteractionMessage()
new ButtonInteractionMessage(
params
):ButtonInteractionMessage
Creates an instance of ButtonInteractionMessage.
Parameters
• params
The parameters for creating the button interaction message.
• params.bodyText: string
The body text of the message.
• params.buttons: object
[]
The buttons of the message.
• params.footerText?: string
The footer text of the message.
Returns
Overrides
InteractiveMessage
.constructor
Memberof
ButtonInteractionMessage
Source
packages/wapi.js/src/structures/interaction/index.ts:84
Properties
data
data:
object
buttons
buttons:
object
[]
Implementation of
ButtonInteractionMessageInterface
.data
Source
packages/wapi.js/src/structures/interaction/index.ts:71
interactiveMessageData
readonly
interactiveMessageData:object
bodyText
bodyText:
string
footerText?
optional
footerText:string
header?
optional
header:object
|object
|object
|object
type
Implementation of
ButtonInteractionMessageInterface
.interactiveMessageData
Inherited from
InteractiveMessage
.interactiveMessageData
Source
packages/wapi.js/src/structures/interaction/index.ts:31
messaging_product
messaging_product:
"whatsapp"
The messaging product.
Implementation of
ButtonInteractionMessageInterface
.messaging_product
Inherited from
InteractiveMessage
.messaging_product
Source
packages/wapi.js/src/structures/message/index.ts:17
recipient_type
recipient_type:
"individual"
The recipient type.
Implementation of
ButtonInteractionMessageInterface
.recipient_type
Inherited from
InteractiveMessage
.recipient_type
Source
packages/wapi.js/src/structures/message/index.ts:18
type
type:
MessageTypeEnum
The type of the message.
Implementation of
ButtonInteractionMessageInterface
.type
Inherited from
Source
packages/wapi.js/src/structures/message/index.ts:16
Methods
addFooter()
addFooter(
footerText
):void
Adds a footer to the message.
Parameters
• footerText: string
The footer text to be added.
Returns
void
Source
packages/wapi.js/src/structures/interaction/index.ts:108
addHeader()
addHeader():
void
Adds a header to the message.
Returns
void
Source
packages/wapi.js/src/structures/interaction/index.ts:102
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
InteractiveMessage
.parseConstructorPayload
Throws
An error if the parsing fails.
Source
packages/wapi.js/src/structures/message/index.ts:42
toJson()
toJson(
params
):object
&object
Converts the message to JSON format.
Parameters
• params
The parameters for converting the message to JSON.
• params.replyToMessageId?: string
The ID of the message to reply to.
• params.to: string
The recipient of the message.
Returns
object
& object
The JSON representation of the message.
Overrides
Memberof
ButtonInteractionMessage