Class: StickerMessage
Represents a sticker message.Implements
Extends
BaseMessage<MessageTypeEnum.Sticker>
Implements
Constructors
new StickerMessage()
new StickerMessage(Creates a new instance of the StickerMessage class.params):StickerMessage
Parameters
• params:object | object
The parameters to initialize the sticker message.
Returns
StickerMessage
Overrides
BaseMessage<MessageTypeEnum.Sticker>.constructor
Memberof
StickerMessageSource
packages/wapi.js/src/structures/media/index.ts:238Properties
data
data:object|object
Implementation of
StickerMessageInterface.data
Source
packages/wapi.js/src/structures/media/index.ts:227messaging_product
messaging_product: "whatsapp"
The messaging product.
Implementation of
StickerMessageInterface.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
StickerMessageInterface.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
StickerMessageInterface.type
Inherited from
BaseMessage.type
Source
packages/wapi.js/src/structures/message/index.ts:16Methods
parseConstructorPayload()
Parses the constructor payload using the provided schema.protectedparseConstructorPayload(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 sticker message to the WhatsApp Cloud API payload.params):object
Parameters
• params The parameters for the WhatsApp Cloud API payload. • params.replyToMessageId?:string
The ID of the message being replied to.
• params.to: string
The recipient of the message.
Returns
object
- The WhatsApp Cloud API payload for the sticker message.
biz_opaque_callback_data?
optionalbiz_opaque_callback_data:string
context?
optionalcontext:object
context.message_id
message_id: string
messaging_product
messaging_product: "whatsapp"
recipient_type
recipient_type: "individual"
sticker
sticker:object|object
to
to: string
type
type: Sticker
Overrides
BaseMessage.toJson