Added ReactionMessage for React User Message with Emoji (#1382)

* Add react type

* Add ReactionMessage

* Add reactionMessage example...

* Lint fix...
This commit is contained in:
Ami
2022-03-23 02:05:13 +07:00
committed by GitHub
parent 3cefad2c8e
commit 3a52f06c0f
3 changed files with 14 additions and 1 deletions

View File

@@ -402,6 +402,15 @@ const listMessage = {
}
const sendMsg = await sock.sendMessage(id, listMessage)
const reactionMessage = {
react: {
text: "💖",
key: message.key
}
}
const sendMsg = await sock.sendMessage(id, reactionMessage)
```
### Media Messages

View File

@@ -112,6 +112,8 @@ export type AnyRegularMessageContent = (
} |
{
location: WALocationMessage
} | {
react: proto.IReactionMessage
}
) & ViewOnce

View File

@@ -276,6 +276,8 @@ export const generateWAMessageContent = async(
}
} else if('location' in message) {
m.locationMessage = WAProto.LocationMessage.fromObject(message.location)
} else if('react' in message) {
m.reactionMessage = WAProto.ReactionMessage.fromObject(message.react)
} else if('delete' in message) {
m.protocolMessage = {
key: message.delete,
@@ -563,4 +565,4 @@ export const downloadMediaMessage = async(message: WAMessage, type: 'buffer' | '
}
return stream
}
}