feat: load reactions in message (#1897)

* msg find reactions

* reaction list

* return hasReaction  only true or false

---------

Co-authored-by: Rajeh Taher <rajeh@reforward.dev>
This commit is contained in:
tofers
2023-04-01 17:03:21 +03:00
committed by GitHub
parent c44af204a1
commit 780005a81a
2 changed files with 60 additions and 1 deletions

14
index.d.ts vendored
View File

@@ -649,6 +649,7 @@ declare namespace WAWebJS {
* broadcast: false,
* fromMe: false,
* hasQuotedMsg: false,
* hasReaction: false,
* location: undefined,
* mentionedIds: []
* }
@@ -678,6 +679,8 @@ declare namespace WAWebJS {
hasMedia: boolean,
/** Indicates if the message was sent as a reply to another message */
hasQuotedMsg: boolean,
/** Indicates whether there are reactions to the message */
hasReaction: boolean,
/** Indicates the duration of the message in seconds */
duration: string,
/** ID that represents the message */
@@ -779,6 +782,10 @@ declare namespace WAWebJS {
* Gets the payment details associated with a given message
*/
getPayment: () => Promise<Payment>,
/**
* Gets the reactions associated with the given message
*/
getReactions: () => Promise<ReactionList[]>,
}
/** ID that represents a message */
@@ -1381,6 +1388,13 @@ declare namespace WAWebJS {
senderId: string
ack?: number
}
export type ReactionList = {
id: string,
aggregateEmoji: string,
hasReactionByMe: boolean,
senders: Array<Reaction>
}
}
export = WAWebJS