Class: ReactionMessage
Represents a reaction message.Implements
Extends
BaseMessage
<MessageTypeEnum.Reaction
>
Implements
Constructors
new ReactionMessage()
new ReactionMessage(Creates a new instance of ReactionMessage.params
):ReactionMessage
Parameters
• params The parameters for creating the reaction message. • params.emoji:string
The emoji to use as a reaction.
• params.messageId: string
The ID of the message to react to.
Returns
ReactionMessage
Overrides
BaseMessage<MessageTypeEnum.Reaction>.constructor
Memberof
ReactionMessageSource
packages/wapi.js/src/structures/reaction/index.ts:30Properties
data
data: object
emoji
emoji: string
messageId
messageId: string
Implementation of
ReactionMessageInterface
.data
Source
packages/wapi.js/src/structures/reaction/index.ts:17messaging_product
messaging_product: "whatsapp"
The messaging product.
Implementation of
ReactionMessageInterface
.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
ReactionMessageInterface
.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
ReactionMessageInterface
.type
Inherited from
BaseMessage.type
Source
packages/wapi.js/src/structures/message/index.ts:16Methods
parseConstructorPayload()
Parses the constructor payload using the provided schema.protected
parseConstructorPayload(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()
toJson(Converts the reaction message to a JSON object.params
):object
Parameters
• params The parameters for converting the reaction message to JSON. • params.to:string
The recipient of the reaction message.
Returns
object
- The JSON representation of the reaction message.
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"
reaction
reaction:object
=ReactionDataPayloadSchemaType
reaction.emoji
emoji: string
reaction.message_id
message_id: string
recipient_type
recipient_type: "individual"
to
to: string
type
type: Reaction
Overrides
BaseMessage.toJson