> ## Documentation Index
> Fetch the complete documentation index at: https://docs.erlc.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Sending Discord Messages, Embeds, and Webhooks in Studio

> Send plain messages, rich embeds, webhook posts, emoji reactions, and interactive components from your erlc.dev Studio automation flows.

Studio gives you a full suite of blocks for sending, editing, and reacting to Discord messages — from a plain text message in a channel to a richly formatted embed with interactive buttons. This page covers every message and embed block available in the block editor, along with helper value blocks for colors, timestamps, and mentions.

## Simple Messages

Use these blocks to send, edit, or delete text messages in Discord channels or via direct message.

<CardGroup cols={2}>
  <Card title="Send Message" icon="paper-plane">
    **`erlc_bot_send_message`** — Send a plain text message to a channel.

    | Input | Description |
    | - | - |
    | `CHANNEL_ID` | The target channel |
    | `CONTENT` | The message text |
  </Card>

  <Card title="Reply to Message" icon="reply">
    **`erlc_bot_reply_message`** — Reply to an existing message.

    | Input | Description |
    | - | - |
    | `MESSAGE_ID` | The message to reply to |
    | `CHANNEL_ID` | The channel containing the message |
    | `CONTENT` | The reply text |
  </Card>

  <Card title="DM a User" icon="envelope">
    **`erlc_bot_dm_user`** — Send a direct message to a server member.

    | Input | Description |
    | - | - |
    | `MEMBER_ID` | The recipient's user ID |
    | `CONTENT` | The message text |
  </Card>

  <Card title="Edit Message" icon="pen">
    **`erlc_bot_edit_message`** — Edit an existing message sent by the bot.

    | Input | Description |
    | - | - |
    | `MESSAGE_ID` | The message to edit |
    | `CHANNEL_ID` | The channel containing the message |
    | `CONTENT` | The new message text |
  </Card>
</CardGroup>

### Deleting Messages

<CardGroup cols={2}>
  <Card title="Delete Message" icon="trash">
    **`erlc_bot_delete_message`** — Delete a single message.

    | Input | Description |
    | - | - |
    | `MESSAGE_ID` | The message to delete |
    | `CHANNEL_ID` | The channel containing the message |
  </Card>

  <Card title="Bulk Delete Messages" icon="trash-list">
    **`erlc_bot_delete_messages`** — Delete multiple messages at once (up to Discord's bulk-delete limit).

    | Input | Description |
    | - | - |
    | `CHANNEL_ID` | The channel to bulk-delete from |
    | `AMOUNT` | Number of messages to delete |
  </Card>
</CardGroup>

### Publishing and Pinning

* **`erlc_bot_publish_message`** — Cross-post a message from an announcement channel to all following channels. Inputs: `MESSAGE_ID`, `CHANNEL_ID`.
* **`erlc_bot_pin_message`** — Pin or unpin a message. Inputs: `MESSAGE_ID`, `CHANNEL_ID`. Set the `PINNED` field to `true` to pin or `false` to unpin.

### Fetching Messages

Use **`erlc_bot_fetch_message`** to retrieve a message and store its data for later blocks. Inputs: `MESSAGE_ID`, `CHANNEL_ID`.

After fetching, read message properties with **`erlc_discord_bot_result_value`** by selecting a field from the dropdown:

| Field | Description |
| - | - |
| `id` | The message's snowflake ID |
| `channel_id` | The channel the message belongs to |
| `content` | The message text content |
| `author_id` | The Discord user ID of the author |
| `code` | HTTP response code |
| `url` | Jump URL to the message |
| `status` | Status string from the API response |

***

## Interaction Replies

When your automation is triggered by a slash command or button interaction, use these blocks to respond.

<Note>
  Interaction reply blocks only work inside a trigger that provides an interaction context, such as `erlc_when_slash_command` or `erlc_when_discord_button`. Using them outside of an interaction trigger will cause an error.
</Note>

| Block | Description |
| - | - |
| `erlc_bot_interaction_reply` | Send the initial reply to the interaction. Input: `CONTENT` |
| `erlc_bot_edit_interaction_response` | Edit the reply after it has been sent. Input: `CONTENT` |
| `erlc_bot_delete_interaction_response` | Delete the interaction reply entirely |
| `erlc_embed_send_hidden` | Send an ephemeral reply visible only to the user who triggered the interaction. Input: `BLOCKS` (statement) |

<Tip>
  Use `erlc_embed_send_hidden` to send private confirmation messages after a user clicks a button or submits a modal — other members won't see the response.
</Tip>

***

## Reactions

Add or remove emoji reactions on messages.

* **`erlc_bot_add_reaction`** — Add an emoji reaction to a message.
  * Inputs: `EMOJI`, `MESSAGE_ID`, `CHANNEL_ID`
* **`erlc_bot_remove_reaction`** — Remove a specific user's reaction from a message.
  * Inputs: `EMOJI`, `MEMBER_ID`, `MESSAGE_ID`, `CHANNEL_ID`

<Info>
  For the `EMOJI` input, use the emoji's Unicode character for standard emoji (e.g., `👍`) or the custom emoji format `<:name:id>` for server emoji.
</Info>

***

## Webhooks

Send messages and embeds through a Discord webhook URL without requiring the bot to be in the channel.

* **`erlc_discord_webhook`** — Send a plain text message via webhook.
  * Inputs: `URL` (the webhook URL), `CONTENT`
* **`erlc_embed_webhook`** — Send an embed via webhook. Connect embed component blocks to the `BLOCKS` statement input.
  * Inputs: `URL`, `BLOCKS` (statement)

***

## Embeds

Embeds let you send richly formatted cards to Discord with titles, descriptions, fields, images, and interactive components. Studio supports both embed **v2** and **v1**.

### Sending Embeds

<CardGroup cols={2}>
  <Card title="Send Embed" icon="rectangle-wide">
    **`erlc_embed_send`** — Send an embed to a channel.

    | Input / Field | Description |
    | - | - |
    | `CHANNEL_ID` input | Target channel |
    | `BLOCKS` statement | Embed component blocks |
    | `EMBED_VERSION` field | `v2` or `v1` |
  </Card>

  <Card title="Reply with Embed" icon="reply">
    **`erlc_embed_reply`** — Reply to a message with an embed.

    | Input | Description |
    | - | - |
    | `MESSAGE_ID` | Message to reply to |
    | `CHANNEL_ID` | Channel of that message |
    | `BLOCKS` statement | Embed component blocks |
  </Card>

  <Card title="Ephemeral Embed" icon="eye-slash">
    **`erlc_embed_send_hidden`** — Send an embed visible only to the invoking user.

    | Input | Description |
    | - | - |
    | `BLOCKS` statement | Embed component blocks |
  </Card>

  <Card title="Edit Embed" icon="pen-to-square">
    **`erlc_bot_edit_embed`** — Overwrite the embed on an existing bot message.

    | Input | Description |
    | - | - |
    | `MESSAGE_ID` | Message containing the embed |
    | `CHANNEL_ID` | Channel of that message |
    | `BLOCKS` statement | New embed component blocks |
  </Card>
</CardGroup>

### Embed Component Blocks

Place these blocks inside an embed's `BLOCKS` statement input to build the embed's content. Stack them in any order.

<Accordion title="Content Blocks">
  | Block | Inputs / Fields | Description |
  | - | - | - |
  | `erlc_embed_title` | `VALUE` input | Sets the embed title text |
  | `erlc_embed_description` | `VALUE` input | Sets the body description |
  | `erlc_embed_color` | `VALUE` input | Sets the sidebar accent color — connect an `erlc_discord_rgb` block |
  | `erlc_embed_author` | `VALUE` input | Sets the author name displayed above the title |
  | `erlc_embed_footer` | `VALUE` input | Sets the footer text |
  | `erlc_embed_thumbnail` | `VALUE` input (URL) | Sets the small thumbnail image in the top-right corner |
  | `erlc_embed_image` | `VALUE` input (URL), `DESCRIPTION` input; `SPOILER` field | Sets the large image at the bottom of the embed |
  | `erlc_embed_timestamp` | *(no inputs)* | Appends the current timestamp next to the footer |
  | `erlc_embed_message_content` | `CONTENT` input | Adds plain text message content alongside a v2 embed |
</Accordion>

<Accordion title="Field Blocks">
  **`erlc_embed_field`** — Adds a name/value field to the embed.

  | Input / Field | Description |
  | - | - |
  | `NAME` input | Field title |
  | `VALUE` input | Field body text |
  | `INLINE` field | Check to display the field inline with adjacent inline fields |
</Accordion>

<Accordion title="Layout Blocks (v2)">
  **`erlc_embed_separator`** — Inserts a visual divider between sections.

  | Field | Values |
  | - | - |
  | `DIVIDER` | Checkbox — show a visible line |
  | `SPACING` | `1` = small gap, `2` = large gap |

  **`erlc_embed_card`** — Wraps a group of embed blocks inside a card container.

  | Input / Field | Description |
  | - | - |
  | `PARTS` statement | Embed component blocks to place inside the card |
  | `SPOILER` field | Marks the card content as a spoiler |
</Accordion>

<Accordion title="Interactive Components">
  **`erlc_embed_button`** — Adds a clickable button to the embed.

  | Input / Field | Description |
  | - | - |
  | `LABEL` input | Button text |
  | `EMOJI` input | Optional emoji displayed on the button |
  | `CUSTOM_ID` field | Unique ID used to identify which button was clicked |
  | `STYLE` field | `1` = Primary, `2` = Secondary, `3` = Success, `4` = Danger |
  | `DISABLED` field | Checkbox — disables the button |

  **`erlc_embed_link_button`** — A button that opens a URL when clicked.

  | Input / Field | Description |
  | - | - |
  | `LABEL` input | Button text |
  | `URL` input | URL to open |
  | `EMOJI` input | Optional emoji |
  | `DISABLED` field | Checkbox — disables the button |

  **`erlc_embed_select_menu`** — Adds a dropdown select menu to the embed.

  | Input / Field | Description |
  | - | - |
  | `PLACEHOLDER` input | Placeholder text shown before a selection |
  | `OPTIONS` statement | Connect `erlc_embed_select_option` blocks |
  | `CUSTOM_ID` field | Unique ID for the menu |
  | `MIN_VALUES` field | Minimum number of selections required |
  | `MAX_VALUES` field | Maximum number of selections allowed |
  | `DISABLED` field | Checkbox — disables the menu |

  **`erlc_embed_select_option`** — An individual option inside a select menu.

  | Input | Description |
  | - | - |
  | `LABEL` input | Display text for the option |
  | `VALUE` input | Internal value returned when selected |
  | `DESCRIPTION` input | Optional subtitle text |
  | `EMOJI` input | Optional emoji |
</Accordion>

***

## Helper Value Blocks

Use these value blocks as inputs to message and embed blocks.

### Colors

**`erlc_discord_rgb`** — Combine red, green, and blue channel values into a single color value for `erlc_embed_color`.

Inputs: `R`, `G`, `B` (each 0–255)

### Timestamps

**`erlc_discord_timestamp`** — Format a Unix timestamp as a Discord dynamic timestamp that updates in the user's local timezone.

| Input / Field | Description |
| - | - |
| `TIME` input | Unix timestamp value |
| `STYLE` field | `t` = short time, `T` = long time, `d` = short date, `D` = long date, `R` = relative (e.g. "5 minutes ago") |

### Text Formatting

* **`erlc_discord_escape`** — Escapes markdown characters in a text value so they display literally. Input: `TEXT`

### Mentions

| Block | Output |
| - | - |
| `erlc_discord_mention_user` | `<@id>` — mentions a user. Input: `ID` |
| `erlc_discord_mention_role` | `<@&id>` — mentions a role. Input: `ID` |

### Server Value Dropdowns

These blocks let you select a channel, role, or user from a dropdown populated with your server's data, and output their ID as a value.

| Block | Field | Output |
| - | - | - |
| `erlc_discord_channel_value` | `ID` dropdown | Channel ID |
| `erlc_discord_role_value` | `ID` dropdown | Role ID |
| `erlc_discord_user_value` | `ID` dropdown | User ID |

***

## Example: Rich Embed with Title, Description, Color, and Button

The JSON below sends an embed to a channel with a title, description, a green accent color, and a primary-style button.

```json theme={null}
{
  "type": "erlc_embed_send",
  "id": "send_embed_1",
  "fields": {
    "EMBED_VERSION": "v2"
  },
  "inputs": {
    "CHANNEL_ID": {
      "block": {
        "type": "erlc_discord_channel_value",
        "id": "channel_val_1",
        "fields": { "ID": "1234567890123456789" }
      }
    },
    "BLOCKS": {
      "block": {
        "type": "erlc_embed_title",
        "id": "title_1",
        "inputs": {
          "VALUE": {
            "block": {
              "type": "text",
              "id": "title_text_1",
              "fields": { "TEXT": "Patrol Started" }
            }
          }
        },
        "next": {
          "block": {
            "type": "erlc_embed_description",
            "id": "desc_1",
            "inputs": {
              "VALUE": {
                "block": {
                  "type": "text",
                  "id": "desc_text_1",
                  "fields": { "TEXT": "A new patrol session has been started. Stay safe out there!" }
                }
              }
            },
            "next": {
              "block": {
                "type": "erlc_embed_color",
                "id": "color_1",
                "inputs": {
                  "VALUE": {
                    "block": {
                      "type": "erlc_discord_rgb",
                      "id": "rgb_1",
                      "inputs": {
                        "R": { "block": { "type": "math_number", "id": "r_val", "fields": { "NUM": 87 } } },
                        "G": { "block": { "type": "math_number", "id": "g_val", "fields": { "NUM": 242 } } },
                        "B": { "block": { "type": "math_number", "id": "b_val", "fields": { "NUM": 135 } } }
                      }
                    }
                  }
                },
                "next": {
                  "block": {
                    "type": "erlc_embed_button",
                    "id": "btn_1",
                    "fields": {
                      "CUSTOM_ID": "end_patrol",
                      "STYLE": "3",
                      "DISABLED": "false"
                    },
                    "inputs": {
                      "LABEL": {
                        "block": {
                          "type": "text",
                          "id": "btn_label_1",
                          "fields": { "TEXT": "End Patrol" }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
```

<Tip>
  Chain embed component blocks using `next.block` to build up your embed content in sequence. The order of blocks determines the visual order of elements in the rendered embed.
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.