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

# Embeds and components

> Render embeds, pages, buttons, dropdowns, and Components V2 containers from a response script.

# Embeds and components

> Render embeds, pages, buttons, dropdowns, and Components V2 containers from a response script.

A response script is parsed into tags of the form `{key: value}`. Text before the first tag becomes the message content. The `$v` prefix used elsewhere in raze scripting is accepted and ignored, so `$v{title: Hi}` and `{title: Hi}` are the same thing.

Arguments inside one tag are separated by `&&`.

<Tip>
  The embed grammar is shared with the rest of raze — the [Embeds](/resources/scripting/embeds) page covers it in general. This page covers what is specific to custom commands.
</Tip>

***

## Embeds

<Steps>
  <Step title="Add embed tags to the response">
    ```bash theme={null} theme={null}
    ;cc set rules -- {title: Server rules}{description: Be nice. No spam.}{color: #7B68EE}
    ```
  </Step>

  <Step title="Add fields and a footer">
    ```bash theme={null} theme={null}
    ;cc set rules -- {title: Server rules}{field: 1. Respect && Treat everyone well && true}{field: 2. No spam && Including DMs && true}{footer: Last updated today}
    ```
  </Step>

  <Step title="Preview before publishing">
    ```bash theme={null} theme={null}
    ;cc preview rules
    ```
  </Step>
</Steps>

### Embed tags

| Tag                                      | Notes                                                                                                   |
| :--------------------------------------- | :------------------------------------------------------------------------------------------------------ |
| `{content: (text)}`                      | Plain text above the embed. Repeats are appended on new lines.                                          |
| `{title: (text)}`                        | Embed title.                                                                                            |
| `{description: (text)}`                  | Embed body.                                                                                             |
| `{url: (link)}`                          | Hyperlinks the title. Must be a plain `http(s)` URL — a value still containing `{ }` or `$` is ignored. |
| `{color: (hex)}`                         | `#ff0000` or `ff0000`.                                                                                  |
| `{thumbnail: (url)}`                     | Small image, top right. Must start with `http`.                                                         |
| `{image: (url)}`                         | Large image at the bottom. Must start with `http`.                                                      |
| `{timestamp: true}`                      | Stamps the current time in the footer.                                                                  |
| `{footer: (text) && [icon url]}`         | Footer text and optional icon.                                                                          |
| `{author: (name) && [icon url]}`         | Author name and optional icon.                                                                          |
| `{field: (name) && [value] && [inline]}` | `inline` is `true` or `false`; defaults to **false**.                                                   |

<Note>
  These are the exact key names — there are no `desc`, `thumb`, or `gif` shorthands in a custom command script.
</Note>

### Multiple embeds

Write `{embed}` to start a new embed block. Repeating a unique key (`title`, `description`, `url`, `color`, `image`, `thumbnail`, `footer`, `author`, `timestamp`) starts one implicitly.

```bash theme={null} theme={null}
;cc set staff -- {title: Owners}{description: @a, @b}{embed}{title: Moderators}{description: @c, @d}
```

Up to **10** embeds per message.

***

## Pages

Split a script with `{page}` to send a paginated message with first / previous / next / last navigation buttons.

```bash theme={null} theme={null}
;cc set guide -- {title: Page one}{description: Getting started.}{page}{title: Page two}{description: Next steps.}
```

Each chunk is parsed as its own message, so every page can carry its own embeds.

<Warning>
  **Navigation expires.** The page set is registered against the message that was sent, and those registrations are cleaned up after **48 hours**. Older paginated messages stop responding to their buttons — run the command again for a fresh one.
</Warning>

<Info>
  `;cc preview` shows page 1 only and says so; navigation needs a real invocation.
</Info>

***

## Buttons

```text theme={null} theme={null}
{button: (label) && [style] && [custom id or url] && [emoji: 💬] && [disabled: true] && [action=...]}
```

| Style                | Colour                          |
| :------------------- | :------------------------------ |
| `primary` / `blue`   | Blurple                         |
| `secondary` / `gray` | Grey (default)                  |
| `success` / `green`  | Green                           |
| `danger` / `red`     | Red                             |
| `link`               | Grey with an external-link icon |

* With `link`, the next argument must be the URL.
* With any other style, the next argument is the custom ID; omit it and one is generated.
* Passing a style name as the *first* argument makes an icon-only button with no label.
* Maximum **5** buttons per message.

```bash theme={null} theme={null}
;cc set links -- Useful links:{button: Website && link && https://example.com}{button: Support && link && https://example.com/support}
```

```bash theme={null} theme={null}
;cc set confirm -- Ready?{button: Yes && success && action=response{content: Confirmed! && ephemeral: true}}{button: No && danger && action=response{content: Cancelled. && ephemeral: true}}
```

***

## Dropdowns

Two grammars are supported, and the tag name you type decides which one is used.

<Tabs>
  <Tab title="Compact — dropdown">
    ```text theme={null} theme={null}
    {dropdown: (custom id) && (placeholder) && (Label|Action|Description|Emoji) && ...}
    ```

    Each option is one argument, its four parts separated by `|`. Only the label is required.

    ```bash theme={null} theme={null}
    ;cc set colour -- {dropdown: colour && Choose a colour && Red|reply=You chose red|Warm|🔴 && Blue|reply=You chose blue|Cool|🔵}
    ```

    `reply=(text)` is shorthand for a response action.
  </Tab>

  <Tab title="Explicit — select">
    ```text theme={null} theme={null}
    {select: (placeholder) && [custom id] && option: (label) && [value: v] && [description: d] && [emoji: e] && [action=...]}
    ```

    Start each new option with `option:`; the keys after it belong to that option until the next `option:`.

    ```bash theme={null} theme={null}
    ;cc set colour -- {select: Choose a colour && colour && option: Red && value: red && description: Warm && emoji: 🔴 && action=response{content: You chose red && ephemeral: true} && option: Blue && value: blue && emoji: 🔵}
    ```

    A literal `|` inside a `{select}` label or description is kept as-is.
  </Tab>
</Tabs>

Add `disabled: true` as an argument to render the menu greyed out. Maximum **2** dropdowns per message and **25** options each.

***

## Component actions

`action=` defines what happens when a button is pressed or an option is chosen.

<AccordionGroup>
  <Accordion title="Send a response" icon="reply">
    ```text theme={null} theme={null}
    action=response{content: (text) && ephemeral: true}
    ```

    The response may also carry embed keys — `title`, `description`, `color`, `field`, and so on.
  </Accordion>

  <Accordion title="Give or take roles" icon="user-tag">
    ```text theme={null} theme={null}
    action=role{id: (role id)}
    action=add_role{id: (role id)}
    action=remove_role{id: (role id)}
    ```

    `role` toggles. Pass several IDs separated by commas. Roles above raze, or roles carrying Administrator, are skipped.
  </Accordion>

  <Accordion title="Open a modal" icon="window-maximize">
    ```text theme={null} theme={null}
    action=modal{title: (title) && id: (modal id) && channel: [channel id] && input{label: (label) && style: short && id: (input id)} && on_submit: response{content: Submitted!}}
    ```

    `style` is `short` or `paragraph`. Add more `input{...}` blocks for more fields. With `channel:` set, submissions are also posted to that channel as a summary embed.
  </Accordion>

  <Accordion title="Run a moderation, economy, or database action" icon="bolt">
    Use the same grammar as script [actions](/server-config/custom-commands/actions), with `&&` between arguments.

    ```bash theme={null} theme={null}
    {button: Ban && danger && action=mod:ban {target.id} && Repeated spamming}
    {button: Strike && secondary && action=customdb:increment strikes && {target.id}}
    ```

    Economy actions were removed — see [Actions](/server-config/custom-commands/actions#economy-actions-removed).
  </Accordion>
</AccordionGroup>

<Warning>
  **The clicker is checked, not the author.** raze verifies that whoever pressed the button holds the permission mapped to that action, and refuses with an ephemeral error otherwise. An action type with no permission mapping — usually a typo — is denied outright.
</Warning>

***

## Containers

`{container: ...}` renders a Components V2 layout instead of an embed.

```text theme={null} theme={null}
{container: title: (text) && text: (text) && separator && button: (label) && primary && color: #7B68EE}
```

| Part                              | Does                                              |
| :-------------------------------- | :------------------------------------------------ |
| `title: (text)`                   | Bold section heading.                             |
| `text: (text)`                    | A block of text.                                  |
| `image: (url)` / `gallery: (url)` | Full-width media.                                 |
| `thumbnail: (url)`                | Attaches a thumbnail to the preceding text block. |
| `button: (label) && (style/url)`  | A button, grouped 5 per row.                      |
| `select: (placeholder) && ...`    | A dropdown, using the `{select}` grammar.         |
| `separator`                       | A divider line.                                   |
| `color: (hex)`                    | Accent stripe down the left edge.                 |

<Warning>
  A container and embeds cannot coexist in one message — if the script produces any embed, the container is dropped. Use one or the other.
</Warning>

***

## Beyond the message

`{react: ...}`, `{attachment: ...}`, `{thread: ...}`, and top-level `{role: ...}` / `{add_role: ...}` / `{remove_role: ...}` all work in a custom command response, alongside the `{delete}`, `{silent}`, `{respond:}`, `{dm}`, and `{cooldown:}` directives. See [Output controls](/server-config/custom-commands/output-controls).

Modals are opened from a component `action=` — see [Open a modal](/server-config/custom-commands/embeds-components#component-actions).
