Struct representing a WhatsApp message key.
Uniquely identifies a message in a chat. Used in receipts, reactions, replies, and deletion.
Fields
| Field | Type | Description |
|---|---|---|
remote_jid | String.t() | Chat JID (user or group) |
from_me | boolean() | Whether the message was sent by you |
id | String.t() | Message ID |
participant | String.t() | Sender JID in group messages |
Examples
key = Irish.MessageKey.from_raw(%{
"remoteJid" => "15551234567@s.whatsapp.net",
"fromMe" => false,
"id" => "ABCDEF123456"
})
key.remote_jid #=> "15551234567@s.whatsapp.net"
# Convert back for the bridge
Irish.MessageKey.to_raw(key)
#=> %{"remoteJid" => "15551234567@s.whatsapp.net", "fromMe" => false, "id" => "ABCDEF123456"}
Summary
Functions
Build a MessageKey from a raw Baileys key map.
Convert back to a camelCase map for sending to the bridge.