UNPKG

@vonage/messages

Version:

Multi-channel messaging that integrates WhatsApp, Facebook, Viber, SMS, and MMS

61 lines 2.02 kB
import { AbstractMessage } from '../AbstractMessage'; import { WhatsAppStickerParams, WhatsAppStickerIdType, WhatsAppStickerUrlType, WhatsAppContext } from '../../types'; import { MessageTypes } from '../../enums/MessageTypes'; import { Channels } from '../../enums'; /** * Represents a sticker message for WhatsApp. * * @group WhatsApp */ export declare class WhatsAppSticker extends AbstractMessage implements WhatsAppStickerParams { /** * The channel for this message (always 'whatsapp'). */ channel: Channels.WHATSAPP; /** * The type of message (always 'sticker'). */ messageType: MessageTypes.STICKER; sticker: WhatsAppStickerIdType | WhatsAppStickerUrlType; context?: WhatsAppContext; /** * Send a sticker message to a WhatsApp user. * * @param {WhatsAppStickerParams} params - The parameters for creating a WhatsApp sticker message. * @example * Send a sticker message with a sticker ID: * ```ts * import { WhatsAppSticker } from '@vonage/messages'; * * const { messageUUID } = await messagesClient.send(new WhatsAppSticker({ * to: TO_NUMBER, * from: FROM_NUMBER, * sticker: { * id: '0-0', * }, * clientRef: 'my-personal-reference', * })); * * console.log(`Message sent successfully with UUID ${messageUUID}`); * ``` * * @example * Send a sticker message with a sticker URL: * ```ts * import { WhatsAppSticker } from '@vonage/messages'; * * const { messageUUID } = await messagesClient.send(new WhatsAppSticker({ * to: TO_NUMBER, * from: FROM_NUMBER, * sticker: { * url: 'https://example.com/sticker.png', * }, * clientRef: 'my-personal-reference', * })); * * console.log(`Message sent successfully with UUID ${messageUUID}`); * ``` */ constructor(params: Omit<WhatsAppStickerParams, 'channel' | 'messageType'>); } //# sourceMappingURL=WhatsAppSticker.d.ts.map