From 324beafed557599dd0bbf1fa2364584a14e29bea Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 11 Oct 2024 11:27:00 +0000 Subject: [PATCH] docs: updated example markdown --- EXAMPLES.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/EXAMPLES.md b/EXAMPLES.md index 6dcae87c..c930bf83 100644 --- a/EXAMPLES.md +++ b/EXAMPLES.md @@ -2059,6 +2059,55 @@ console.log(`Message sent successfully with UUID ${messageUUID}`); ## Vonage Messages Package +### WhatsAppReaction Class + +Represents a reaction message for WhatsApp. + + +#### WhatsAppReaction + +Sends a reaction message to a WhatsApp user. + +Send a reaction + +```ts +import { WhatsAppReaction } from '@vonage/messages'; + +const { messageUUID } = await messagesClient.send(new WhatsAppReaction({ + to: TO_NUMBER, + from: FROM_NUMBER, + reaction: { + action: 'react', + emoji: '😍', + } + clientRef: 'my-personal-reference', +})); + +console.log(`Message sent successfully with UUID ${messageUUID}`); +``` + + + + +Remove reaction + +```ts +import { WhatsAppReaction } from '@vonage/messages'; + +const { messageUUID } = await messagesClient.send(new WhatsAppReaction({ + to: TO_NUMBER, + from: FROM_NUMBER, + reaction: { + action: 'unreact', + } + clientRef: 'my-personal-reference', +})); + +console.log(`Message sent successfully with UUID ${messageUUID}`); +``` + +## Vonage Messages Package + ### WhatsAppSticker Class Represents a sticker message for WhatsApp.