Skip to content

Commit

Permalink
feat: Added sendReactionToMessage function
Browse files Browse the repository at this point in the history
  • Loading branch information
icleitoncosta committed Jul 19, 2022
1 parent c444938 commit edbec84
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/api/layers/sender.layer.ts
Expand Up @@ -1212,4 +1212,29 @@ export class SenderLayer extends ListenerLayer {
{ chatState, chatId }
);
}

/**
* Send reaction to message
* @example
* ```javascript
* // For send Reaction, just to send emoji
* await client.sendReactionToMessage('[number]@c.us', '🤯');
*
* // to remove reacition
* await client.startRecording('[number]@c.us', false);
* ```
* @category Chat
* @param to Chat Id
* @param duration Duration um miliseconds
*/
public async sendReactionToMessage(msgId: string, reaction: string | false) {
return evaluateAndReturn(
this.page,
({ msgId, reaction }) => WPP.chat.sendReactionToMessage(msgId, reaction),
{
msgId,
reaction,
}
);
}
}

0 comments on commit edbec84

Please sign in to comment.