Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reaction method supports message objects #2402

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/api/layers/sender.layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1381,20 +1381,23 @@ 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_<number>@c.us_messageId', '🤯');
*
* // to remove reacition
* await client.startRecording('[number]@c.us', false);
* // to remove a reaction
* await client.sendReactionToMessage('true_<number>@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),
Expand Down
Loading