refactor(client): move sendReaction method to the Client (#201695)
`Message.react` moved to `Client.sendReaction`
This commit is contained in:
parent
a0ff21e67c
commit
11594b2887
1 changed files with 34 additions and 18 deletions
|
|
@ -477,24 +477,7 @@ class Message extends Base {
|
|||
* @return {Promise}
|
||||
*/
|
||||
async react(reaction) {
|
||||
await this.client.pupPage.evaluate(
|
||||
async (messageId, reaction) => {
|
||||
if (!messageId) return null;
|
||||
const msg =
|
||||
window.require('WAWebCollections').Msg.get(messageId) ||
|
||||
(
|
||||
await window
|
||||
.require('WAWebCollections')
|
||||
.Msg.getMessagesById([messageId])
|
||||
)?.messages?.[0];
|
||||
if (!msg) return null;
|
||||
await window
|
||||
.require('WAWebSendReactionMsgAction')
|
||||
.sendReactionToMsg(msg, reaction);
|
||||
},
|
||||
this.id._serialized,
|
||||
reaction,
|
||||
);
|
||||
return this.client.sendReaction(this.id._serialized, reaction);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue