fix: add senderTimestampMs automatically in reactMessage (#1845)

* docs: how to remove the reaction message

* Add `senderTimestampMs` automatically in reactMessage

* fix lint
This commit is contained in:
aqulzz
2022-07-02 21:22:34 +07:00
committed by GitHub
parent a2054d8efa
commit 200b75d53e
2 changed files with 5 additions and 1 deletions

View File

@@ -411,7 +411,7 @@ const sendMsg = await sock.sendMessage(id, listMessage)
const reactionMessage = {
react: {
text: "💖",
text: "💖", // use an empty string to remove the reaction
key: message.key
}
}

View File

@@ -292,6 +292,10 @@ export const generateWAMessageContent = async(
} else if('location' in message) {
m.locationMessage = WAProto.LocationMessage.fromObject(message.location)
} else if('react' in message) {
if(!message.react.senderTimestampMs) {
message.react.senderTimestampMs = Date.now()
}
m.reactionMessage = WAProto.ReactionMessage.fromObject(message.react)
} else if('delete' in message) {
m.protocolMessage = {