# `Irish.MessageKey`
[🔗](https://github.com/jtippett/irish/blob/main/lib/irish/message_key.ex#L1)

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"}

# `t`

```elixir
@type t() :: %Irish.MessageKey{
  from_me: boolean(),
  id: String.t() | nil,
  participant: String.t() | nil,
  remote_jid: String.t() | nil
}
```

# `from_raw`

```elixir
@spec from_raw(map()) :: t()
```

Build a MessageKey from a raw Baileys key map.

# `to_raw`

```elixir
@spec to_raw(t()) :: map()
```

Convert back to a camelCase map for sending to the bridge.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
