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

# Overview

> How mira's scripting works, the three kinds of node, and the rules that apply everywhere.

Scripting lets you build your own messages instead of using the ones mira comes with. You
write plain text with **nodes** in it, and mira swaps those nodes out for real values when the
message is sent.

```text Example theme={null}
Welcome {member.mention}, you're member number {server.member_count}!
```

```text Result theme={null}
Welcome @hellofaman, you're member number 44!
```

## The three kinds of node

Everything in scripting is one of these:

```text Forms theme={null}
{placeholder}                   Swapped out for a value
{name: value}                   Builds part of a message
{placeholder|pipe}              Changes a value
{placeholder|pipe: args}        Changes a value, with settings
```

A **placeholder** stands in for information mira already knows, like a username or a member
count. See [Placeholders](/scripting/placeholders).

A **template node** builds something, like an embed title or a button. See
[Embeds](/scripting/embeds), [Containers](/scripting/containers), and
[Buttons](/scripting/buttons).

A **pipe** changes a value on its way out, like making it uppercase or adding commas to a big
number. See [Pipes and operators](/scripting/pipes-and-operators).

## Rules that apply everywhere

Node names ignore capitalisation, so `{member.NAME}` and `{member.name}` do the same thing.

Spaces around the `:` are up to you. `{title: Hello}` and `{title:Hello}` both work.

A value can run across several lines. Everything up to the closing brace is part of it.

```text Multi-line value theme={null}
{description: First line
Second line
Third line}
```

Several nodes take more than one value at once, and those are split with `&&`. Fields,
footers, authors, and conditions all work this way.

```text Multiple values theme={null}
{field: Scrobbles && 71,437 && inline}
```

<Warning>
  Anything mira doesn't recognise is left exactly as you typed it. A misspelled node like
  `{member.nmae}` won't throw an error, it'll just **appear in the message as written**. If part
  of your script shows up raw, that's almost always a typo.
</Warning>

## Where you can use scripts

WIP

## Where to go next

<CardGroup cols={2}>
  <Card title="placeholders" icon="braces" href="/scripting/placeholders">
    Every value you can pull in, from usernames to Last.fm scrobbles.
  </Card>

  <Card title="Pipes and operators" icon="funnel" href="/scripting/pipes-and-operators">
    Change values, do maths, and add conditions.
  </Card>

  <Card title="Embeds" icon="message-square-text" href="/scripting/embeds">
    Build embeds with titles, fields, images, and footers.
  </Card>

  <Card title="Containers" icon="layout-template" href="/scripting/containers">
    Discord's newer layout blocks, with headers, dividers, and galleries.
  </Card>

  <Card title="Buttons" icon="mouse-pointer-click" href="/scripting/buttons">
    Add buttons under a message or inside a container.
  </Card>

  <Card title="Examples" icon="sparkles" href="/scripting/examples">
    Full scripts you can copy and change.
  </Card>
</CardGroup>
