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

# Variables

> The list of variable for use in flows

# List of variables

### Member

The member who used the component, command or form.

| Variable                    | Description                          |
| :-------------------------- | :----------------------------------- |
| `{{ member.id }}`           | User ID                              |
| `{{ member.name }}`         | Username                             |
| `{{ member.display_name }}` | Nickname or display name or username |
| `{{ member.mention }}`      | User mention                         |
| `{{ member.avatar_url }}`   | Member or user avatar URL            |
| `{{ member.banner_url }}`   | Member or user banner URL            |
| `{{ member.bot }}`          | Whether the user is a bot            |
| `{{ member.role_ids }}`     | Array of role IDs                    |
| `{{ member.created_at }}`   | User creation timestamp              |

### Server

| Variable                    | Description                     |
| :-------------------------- | :------------------------------ |
| `{{ server.id }}`           | Server ID                       |
| `{{ server.name }}`         | Server name                     |
| `{{ server.icon_url }}`     | Server icon URL                 |
| `{{ server.member_count }}` | Approximate server member count |
| `{{ server.boost_count }}`  | Server boost count              |
| `{{ server.created_at }}`   | Server creation timestamp       |

### Miscellaneous

| Variable           | Description                                                     |
| :----------------- | :-------------------------------------------------------------- |
| `{{ channel.id }}` | Channel the interaction occurred in                             |
| `{{ message.id }}` | Message the component or form belongs to                        |
| `{{ result.id }}`  | ID of the message or thread created by the previous flow action |
| `{{ now }}`        | Current timestamp                                               |

## Message Components

### Select Menu

| Variable                                 | Description                                                                                        | Supported select menu types             |
| :--------------------------------------- | :------------------------------------------------------------------------------------------------- | :-------------------------------------- |
| `{{ selected.text }}`                    | What the user selected, formatted to display in a message                                          | All                                     |
| `{{ selected.items }}`                   | Array of formatted selected options                                                                | All                                     |
| `{{ selected.values }}`                  | Array of raw selected options                                                                      | User, role, channel, user & role select |
| `{{ selected.users.<i>.<property> }}`    | Selected users, index i starts at 0, same properties as for [member](/variables#member)            | User select, user & role select         |
| `{{ selected.roles.<i>.<property> }}`    | Selected roles, index i starts at 0, properties: id, name, mention, color\_hex, and color\_decimal | Role select, user & role select         |
| `{{ selected.channels.<i>.<property> }}` | Selected channels, index i starts at 0, properties: id, name, mention, link, and type              | Channel select                          |

## Form

| Variable                                    | Description                                                                                        | Supported field types                   |
| :------------------------------------------ | :------------------------------------------------------------------------------------------------- | --------------------------------------- |
| `{{ fields.<id>.text }}`                    | The users input, formatted to display in a message                                                 | All                                     |
| `{{ fields.<id>.items }}`                   | Array of formatted inputs                                                                          | Select menus, checkboxes, file upload   |
| `{{ fields.<id>.value }}`                   | The raw input                                                                                      | Radio buttons, single checkbox          |
| `{{ fields.<id>.values }}`                  | Array of raw inputs                                                                                | User, role, channel, user & role select |
| `{{ fields.<id>.users.<i>.<property> }}`    | Selected users, index i starts at 0, same properties as for [member](/variables#member)            | User select, user & role select         |
| `{{ fields.<id>.roles.<i>.<property> }}`    | Selected roles, index i starts at 0, properties: id, name, mention, color\_hex, and color\_decimal | Role select, user & role select         |
| `{{ fields.<id>.channels.<i>.<property> }}` | Selected channels, index i starts at 0, properties: id, name, mention, link, and type              | Channel select                          |

## Command

### Slash command

| Variable                                  | Description                                                                                                                                           | Supported option types |
| :---------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| `{{ options.<name>.text }}`               | The users input, formatted to display in a message                                                                                                    | All                    |
| `{{ options.<name>.value }}`              | The raw input                                                                                                                                         | All                    |
| `{{ options.<name>.user.<property> }}`    | Selected user, same properties as for [member](/variables#member)                                                                                     | User, user-or-role     |
| `{{ options.<name>.role.<property> }}`    | Selected role, properties: id, name, mention, color\_hex, and color\_decimal                                                                          | Role, user-or-role     |
| `{{ options.<name>.channel.<property> }}` | Selected channel, properties: id, name, mention, link, and [type](https://docs.discord.com/developers/resources/channel#channel-object-channel-types) | Channel                |

### User command

Use `target` to access properties from the target user.<br />
Same properties as for [member](/variables#member), eg. `{{ target.id }}` or `{{ target.mention }}`

### Message command

| Variable                           | Description                                        |
| :--------------------------------- | :------------------------------------------------- |
| `{{ target.id }}`                  | Message ID                                         |
| `{{ target.content }}`             | Message content                                    |
| `{{ target.link }}`                | Link to the message                                |
| `{{ target.created_at }}`          | Message creation timestamp                         |
| `{{ target.edited_at }}`           | Message edit timestamp, blank if it was not edited |
| `{{ target.author.id }}`           | Author user ID                                     |
| `{{ target.author.name }}`         | Author username                                    |
| `{{ target.author.display_name }}` | Author display name or username                    |
| `{{ target.author.mention }}`      | Author mention                                     |
| `{{ target.author.avatar_url }}`   | Author avatar URL                                  |
| `{{ target.author.bot }}`          | Whether the author is a bot                        |

# Filters

You can apply filters to modfiy certain variables. For example use the timestamp filter on this variable `{{ member.created_at | timestamp: "R" }}` to display it as a relative timestamp. You can add multiple filters to the same variable, by adding another `|` symbol followed by the next filter.

| Filter                                                                                                  | Description                                         |
| :------------------------------------------------------------------------------------------------------ | :-------------------------------------------------- |
| timestamp: "[style](https://docs.discord.com/developers/reference#message-formatting-timestamp-styles)" | Set discord timestamp style                         |
| default: "text"                                                                                         | Replace blank variables with a default value (text) |
