UNPKG

@vonage/messages

Version:

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

53 lines 1.74 kB
import { AbstractMessage } from '../AbstractMessage'; import { WhatsAppStickerParams, WhatsAppStickerIdType, WhatsAppStickerUrlType, WhatsAppContext } from '../../types'; /** * Represents a sticker message for WhatsApp. * * @group WhatsApp */ export declare class WhatsAppSticker extends AbstractMessage implements WhatsAppStickerParams { channel: 'whatsapp'; messageType: '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: WhatsAppStickerParams); } //# sourceMappingURL=WhatsAppSticker.d.ts.map