# `Jido.Chat.SentMessage`
[🔗](https://github.com/agentjido/jido_chat/blob/v1.0.0/lib/jido/chat/sent_message.ex#L1)

Canonical sent-message handle with follow-up lifecycle operations.

# `t`

```elixir
@type t() :: %Jido.Chat.SentMessage{
  adapter: any(),
  attachments: [
    %Jido.Chat.Attachment{
      data: term(),
      duration: term(),
      filename: term(),
      height: term(),
      kind: term(),
      media_type: term(),
      metadata: term(),
      path: term(),
      size_bytes: term(),
      url: term(),
      width: term()
    }
  ],
  author:
    nil
    | nil
    | %Jido.Chat.Author{
        full_name: term(),
        is_bot: term(),
        is_me: term(),
        metadata: term(),
        user_id: term(),
        user_name: term()
      },
  default_opts: any(),
  external_room_id: nil | nil | any(),
  formatted: nil | nil | binary(),
  id: binary(),
  is_mention: boolean(),
  metadata: map(),
  raw: nil | nil | any(),
  response: %Jido.Chat.Response{
    channel_id: term(),
    channel_type: term(),
    chat_id: term(),
    date: term(),
    external_message_id: term(),
    external_room_id: term(),
    message_id: term(),
    metadata: term(),
    raw: term(),
    status: term(),
    timestamp: term()
  },
  text: nil | nil | binary(),
  thread_id: binary()
}
```

# `add_reaction`

```elixir
@spec add_reaction(t(), String.t() | atom(), keyword()) :: :ok | {:error, term()}
```

Adds a reaction to the message when supported by the adapter.

# `delete`

```elixir
@spec delete(
  t(),
  keyword()
) :: :ok | {:error, term()}
```

Deletes the message when supported by the adapter.

# `edit`

```elixir
@spec edit(t(), String.t() | Jido.Chat.Postable.t() | map(), keyword()) ::
  {:ok, t()} | {:error, term()}
```

Edits the message using the canonical outbound payload contract.

# `from_map`

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

Builds a sent message from serialized map data.

# `new`

Creates a sent-message handle from normalized adapter response data.

# `remove_reaction`

```elixir
@spec remove_reaction(t(), String.t() | atom(), keyword()) :: :ok | {:error, term()}
```

Removes a reaction from the message when supported by the adapter.

# `schema`

Returns the Zoi schema for SentMessage.

# `to_map`

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

Serializes the sent message into a plain map with type marker.

---

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