ReactionMessage
Wapi.js Docs / ReactionMessage
Class: ReactionMessage
Represents a reaction message.
Implements
Extends
BaseMessage
<MessageTypeEnum.Reaction
>
Implements
Constructors
new ReactionMessage()
new ReactionMessage(
params
):ReactionMessage
Creates a new instance of 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
Overrides
BaseMessage<MessageTypeEnum.Reaction>.constructor
Memberof
ReactionMessage
Source
packages/wapi.js/src/structures/reaction/index.ts:30
Properties
data
data:
object
emoji
emoji:
string
messageId
messageId:
string
Implementation of
Source
packages/wapi.js/src/structures/reaction/index.ts:17
messaging_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:17
recipient_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:18
type
type:
MessageTypeEnum
The type of the message.
Implementation of
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()
toJson(
params
):object
Converts the reaction message to a JSON 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
Memberof
ReactionMessage
Source
Was this page helpful?