From 2fb3c6f458410d6f45046b2ce6483f69fbf3982b Mon Sep 17 00:00:00 2001 From: gekkedev <17025257+gekkedev@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:47:31 +0100 Subject: [PATCH 1/2] fix: reaction method supports message objects --- src/api/layers/sender.layer.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/api/layers/sender.layer.ts b/src/api/layers/sender.layer.ts index ac3f28a13..a87e4fdbf 100644 --- a/src/api/layers/sender.layer.ts +++ b/src/api/layers/sender.layer.ts @@ -1381,20 +1381,20 @@ export class SenderLayer extends ListenerLayer { } /** - * Send reaction to message + * Send reaction to a message * @example * ```javascript - * // For send Reaction, just to send emoji - * await client.sendReactionToMessage('[number]@c.us', '🤯'); + * // to send an emoji reaction + * await client.sendReactionToMessage('true_@c.us_messageId', '🤯'); * - * // to remove reacition - * await client.startRecording('[number]@c.us', false); + * // to remove a reaction + * await client.sendReactionToMessage('true_@c.us_messageId', false); * ``` * @category Chat - * @param to Chat Id - * @param duration Duration um miliseconds + * @param msgId Message Id or `Message` object + * @param reaction Emoji as string or `false` to remove an existing reaction */ - public async sendReactionToMessage(msgId: string, reaction: string | false) { + public async sendReactionToMessage(msgId: string | Message, reaction: string | false) { return evaluateAndReturn( this.page, ({ msgId, reaction }) => WPP.chat.sendReactionToMessage(msgId, reaction), From 54b41a2ec7029955a68421b608c0ed26e3ad32c0 Mon Sep 17 00:00:00 2001 From: gekkedev <17025257+gekkedev@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:22:06 +0100 Subject: [PATCH 2/2] fix: ESLint --- src/api/layers/sender.layer.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api/layers/sender.layer.ts b/src/api/layers/sender.layer.ts index a87e4fdbf..edd2e80db 100644 --- a/src/api/layers/sender.layer.ts +++ b/src/api/layers/sender.layer.ts @@ -1394,7 +1394,10 @@ export class SenderLayer extends ListenerLayer { * @param msgId Message Id or `Message` object * @param reaction Emoji as string or `false` to remove an existing reaction */ - public async sendReactionToMessage(msgId: string | Message, reaction: string | false) { + public async sendReactionToMessage( + msgId: string | Message, + reaction: string | false + ) { return evaluateAndReturn( this.page, ({ msgId, reaction }) => WPP.chat.sendReactionToMessage(msgId, reaction),