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

# Triggers

> Create prefix commands that post custom messages or embeds when used in Discord

Triggers are prefix-based commands that the Invaro bot responds to with a custom message. When a server member types your configured prefix followed by a trigger name, the bot posts the associated content. Triggers can be organised into colour-coded categories, restricted to specific roles, posted to a fixed channel, and enhanced with Custom Flows.

***

## How Triggers Work

Every trigger has a name and a prefix. If your prefix is `!` and your trigger is named `rules`, members type `!rules` and the bot responds with whatever you've configured.

***

## Creating a Trigger

Click **New Trigger** from the Triggers page. The trigger form has five tabs:

### Basic tab

Configure the core settings:

| Field               | Description                                                                                                      |
| ------------------- | ---------------------------------------------------------------------------------------------------------------- |
| **Trigger name**    | The word after the prefix — no spaces, lowercase only. Members type `{prefix}{name}` to invoke it.               |
| **Message**         | The plain-text response (when not using embed mode). If embed is on, this becomes optional text above the embed. |
| **Post to channel** | Where the response is posted. Leave empty to reply in the same channel.                                          |
| **Allowed roles**   | Restrict the trigger to members with specific roles. Leave empty to allow everyone.                              |

### Content tab

Toggle **Send as embed** to switch from a plain message to a styled Discord embed. When embed is on you can configure:

* **Accent colour** — the left border colour
* **Embed description** — main body text
* **Title** and **Title URL**
* **Author name** and **Author icon URL**
* **Thumbnail** (top-right image) and **Image** (full-width)
* **Fields** — up to 25 key/value pairs, each optionally inline
* **Footer text** and **Footer icon URL**
* **Timestamp** — appends the current time to the footer

The Content tab also lets you add up to 5 **Link Buttons** — Discord components attached below the message that open a URL when clicked. Each button has an optional emoji, a label, and a required URL.

### Advanced tab

Fine-tune behaviour:

| Setting                     | Description                                                   |
| --------------------------- | ------------------------------------------------------------- |
| **Cooldown**                | Seconds between uses per user (0 = no cooldown)               |
| **Delete response after**   | Seconds until the bot's response is auto-deleted (0 = never)  |
| **Delete invoking message** | Removes the member's command message after the bot responds   |
| **ModMail enabled**         | Allows this trigger to be used inside ModMail thread channels |

### Flows tab

Add **Custom Flows** to chain additional bot actions that fire after the trigger runs. See [Custom Flows](#custom-flows) below. Flows require **Invaro+** or **Invaro+ Boost**.

### Preview tab

Shows a Discord-style rendering of your trigger response before saving.

***

## Available Variables

Click any variable pill in the editor to insert it at your cursor position.

| Variable      | Output                                 |
| ------------- | -------------------------------------- |
| `{user}`      | Mentions the user who used the trigger |
| `{username}`  | Their Discord username                 |
| `{avatar}`    | Their avatar URL                       |
| `{server}`    | Your server's name                     |
| `{channel}`   | Mentions the current channel           |
| `{everyone}`  | @everyone                              |
| `{here}`      | @here                                  |
| `{&rolename}` | Mentions a role by name                |
| `{#channel}`  | Mentions a channel by name             |
| `{date}`      | Current date (MM/DD/YYYY)              |
| `{time}`      | Current time (XX:XX:XX)                |
| `{datetime}`  | Date and time combined                 |
| `{timestamp}` | Unix timestamp ID                      |
| `{year}`      | Current year                           |
| `{month}`     | Current month                          |
| `{day}`       | Current day                            |
| `{args1}`     | First word after the trigger name      |
| `{args2}`     | Second word after the trigger name     |
| `{args3}`     | Third word after the trigger name      |

***

## Custom Flows

<Note>
  Custom Flows are available on **Invaro+** and **Invaro+ Boost** portals only.
</Note>

Custom Flows let you chain additional bot actions that fire after a trigger runs. All enabled flows execute in the order listed. Each flow can be toggled on or off individually.

### Available Flow Actions

| Flow                            | Description                                                                      |
| ------------------------------- | -------------------------------------------------------------------------------- |
| **Delete previous bot message** | Deletes the bot's last message in the channel before sending the new response    |
| **Move channel to category**    | Moves the channel the trigger was run in to a different category                 |
| **Send DM to invoker**          | Sends a direct message to the user who invoked the trigger                       |
| **Send DM to mentioned user**   | Sends a DM to a user mentioned as the first argument — requires `!trigger @user` |
| **Pin bot response**            | Pins the bot's response message in the channel                                   |
| **Add / Remove roles**          | Adds or removes one or more roles from the user who invoked the trigger          |
| **Create thread on response**   | Creates a public thread directly on the bot's response message                   |
| **Create thread in channel**    | Creates a standalone thread in the channel, independent of the bot's response    |
| **Send to mentioned channel**   | Reads a `#channel` mention from the args and sends a message there               |
| **Rename channel**              | Renames the channel where the trigger was used — prepend, append, or replace     |

### Flow Configuration

**Move channel to category** — select the target category from the dropdown.

**Send DM to invoker / Send DM to mentioned user** — choose between:

* **Send trigger response** — the bot DMs a copy of the trigger's embed and plain text
* **Send custom message** — write a separate message using the text editor and variable pills

For **Send DM to mentioned user**, the trigger must be invoked as `!triggerName @user`. If no user is mentioned the flow is skipped.

**Add / Remove roles** — select whether to add or remove, then pick the roles. Applied to the invoker.

**Create thread on response / Create thread in channel** — set a thread name (variables supported) and choose an auto-archive duration: 1 hour, 24 hours, 3 days, or 1 week.

**Send to mentioned channel** — uses the first `#channel` mention in the command args. Choose between sending the trigger response or a custom message.

**Rename channel** — choose a mode:

* **Replace** — sets the channel name to the value you enter
* **Prepend** — adds text before the current channel name
* **Append** — adds text after the current channel name

Variables are supported in the rename value. Discord automatically sanitises names to lowercase with hyphens.

***

## Categories

Categories let you organise triggers into colour-coded groups. Each category has a name, optional description, an icon, and a colour.

### Creating a Category

Click **New Category** in the top-right corner. Give it a name, choose an icon from the grid, and pick a colour.

### Assigning Triggers to Categories

On any trigger card, click the folder icon to open a dropdown and select a category. Choose **Uncategorised** to remove it from its current category.

Triggers inside a category appear nested under that category's header on the list page. Deleting a category does not delete the triggers inside — they become uncategorised.

### Managing Categories

Each category card has an overflow menu with **Edit Category** and **Delete Category** options. The category can also be expanded or collapsed by clicking the header.

***

## Configuring the Prefix

All triggers share a single prefix. Click the **Prefix** button in the top-right area to open an inline editor, change the value (1–5 characters), and confirm. The new prefix takes effect immediately.

***

## Managing Triggers

Each trigger card shows the full command name, description, any configured constraints, and badges for embed mode, custom message, and flows.

| Action               | Description                                                                                                  |
| -------------------- | ------------------------------------------------------------------------------------------------------------ |
| **Toggle**           | Enable or disable the trigger without deleting it                                                            |
| **Duplicate**        | Opens a new trigger pre-filled with the same settings — the name is suffixed with `copy` and must be renamed |
| **Move to category** | Assigns the trigger to a category via the folder dropdown                                                    |
| **Delete**           | Permanently deletes the trigger                                                                              |

Use the **search bar** to filter triggers by name or description.

***

## Access Control

Viewing the Triggers page can be granted to non-admin staff via the Permissions system using `CanView` on the Triggers page. Creating, editing, and deleting triggers may require additional permissions depending on your portal's configuration.
