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

# Triggers & shortcuts

> Autoresponders, automatic reactions, and custom command aliases.

Three ways to make the bot react to what people type.

## Response triggers

An autoresponder. When a message matches the trigger, mira replies.

<CodeGroup>
  ```javascript Simple theme={null}
  !response add gm {content: good morning {user.mention}}
  ```

  ```javascript With an embed theme={null}
  !response add rules {title: Server Rules} {description: Read #rules.} {color: #5cacec}
  ```

  ```javascript View one theme={null}
  !response view gm
  ```

  ```javascript List them theme={null}
  !response list
  ```

  ```javascript Remove theme={null}
  !response remove gm
  ```

  ```javascript Clear theme={null}
  !response clear
  ```
</CodeGroup>

Requires **Manage Messages**. Aliases: `autoresponse`, `autoresponder`, `responder`, `trigger`, `ar`.

Responses are full [scripts](/scripting/overview), so embeds, containers, buttons and [variables](/scripting/variables) all work.

### Restricting where they fire

```javascript theme={null}
!response restrict channel #general gm
!response restrict role @Member gm
```

Both toggle. Once a trigger has any channel restriction it fires **only** in those channels; same for roles. Aliases: `limit`, `exclusive`.

<Tip>
  Restrict anything remotely annoying to one channel. An autoresponder that fires server-wide on a common word gets old within a day, and people will start triggering it on purpose.
</Tip>

## Reaction triggers

Instead of replying, react.

<CodeGroup>
  ```javascript React to a word theme={null}
  !reaction add 🔥 fire
  ```

  ```javascript Multiple triggers theme={null}
  !reaction add 💀 skull
  !reaction add 😭 sob
  ```

  ```javascript List theme={null}
  !reaction list
  ```

  ```javascript Remove theme={null}
  !reaction remove fire
  ```

  ```javascript Clear theme={null}
  !reaction clear
  ```
</CodeGroup>

Requires **Manage Messages**. Aliases: `react`, `rt`.

### React to everything in a channel

```javascript theme={null}
!reaction channel #art 🔥
!reaction channel list
!reaction channel remove #art
```

Every message in that channel gets the reaction. The standard setup for a showcase channel — see also [gallery channels](/setup/channels#gallery-channels).

### Reacting to the previous message

```javascript theme={null}
!previousreact add 💀 lmao
```

When someone types the trigger, the reaction goes on the message **before** theirs. So typing "lmao" puts 💀 on the message that was actually funny.

```javascript theme={null}
!previousreact list
!previousreact remove lmao
!previousreact clear
```

Aliases: `previousreaction`, `prt`, `pr`.

<Note>
  This is one of those features that seems pointless until a server starts using it, at which point it becomes the main way people react to things.
</Note>

## Command shortcuts

Map a word to a full command, including arguments.

<CodeGroup>
  ```javascript Simple alias theme={null}
  !shortcut add p purge
  ```

  ```javascript With a fixed argument theme={null}
  !shortcut add mod role {0} @Moderator
  ```

  ```javascript View one theme={null}
  !shortcut view mod
  ```

  ```javascript List theme={null}
  !shortcut list
  ```

  ```javascript Remove theme={null}
  !shortcut remove mod
  ```
</CodeGroup>

Requires **Manage Server**. Aliases: `alias`, `shortcuts`, `aliases`.

`{0}` is replaced with whatever the member types after the shortcut. So `!mod @jake` becomes `!role @jake @Moderator`.

Useful shapes:

```javascript theme={null}
!shortcut add mute timeout {0} 1h
!shortcut add verify role {0} @Verified
!shortcut add nuke2 purge 100
!shortcut add warn2 warn {0} breaking rules
```

<Warning>
  Shortcuts inherit the permissions of the command they run. `!shortcut add ban2 ban {0}` doesn't let non-moderators ban people — they still need Ban Members, or a [fake permission](/security/fake-permissions).
</Warning>

## Choosing between them

| I want to...                           | Use                                                       |
| -------------------------------------- | --------------------------------------------------------- |
| Reply with text or an embed            | **Response trigger**                                      |
| Add a reaction                         | **Reaction trigger**                                      |
| React to the message *above*           | **Previous reaction trigger**                             |
| React to everything in a channel       | **Reaction channel**                                      |
| Shorten a command                      | **Shortcut**                                              |
| Answer privately when clicked          | [Response buttons](/setup/auto-messages#response-buttons) |
| Reply automatically to *every* message | You don't. Restrict it.                                   |

## Command reference

| Command                                         | Permission      | Description                      |
| ----------------------------------------------- | --------------- | -------------------------------- |
| `response add <trigger> <script>`               | Manage Messages | Create an autoresponder          |
| `response view <trigger>`                       | Manage Messages | Preview one                      |
| `response list`                                 | Manage Messages | All triggers                     |
| `response remove <trigger>`                     | Manage Messages | Remove one                       |
| `response clear`                                | Manage Roles    | Remove all                       |
| `response restrict channel <channel> <trigger>` | Manage Messages | Limit to channels                |
| `response restrict role <role> <trigger>`       | Manage Messages | Limit to roles                   |
| `reaction add <emoji> <trigger>`                | Manage Messages | Create a reaction trigger        |
| `reaction list`                                 | Manage Messages | All reaction triggers            |
| `reaction remove <trigger>`                     | Manage Messages | Remove one                       |
| `reaction clear`                                | Manage Roles    | Remove all                       |
| `reaction channel [channel]`                    | Manage Messages | React to everything in a channel |
| `reaction channel list`                         | Manage Messages | Configured channels              |
| `reaction channel remove <channel>`             | Manage Messages | Stop                             |
| `previousreact add <emoji> <trigger>`           | Manage Messages | React to the previous message    |
| `previousreact list`                            | Manage Messages | All of them                      |
| `previousreact remove <trigger>`                | Manage Messages | Remove one                       |
| `previousreact clear`                           | Manage Roles    | Remove all                       |
| `shortcut add <name> <invoke>`                  | Manage Server   | Create an alias                  |
| `shortcut view <alias>`                         | Manage Server   | What it runs                     |
| `shortcut list`                                 | Manage Server   | All shortcuts                    |
| `shortcut remove <alias>`                       | Manage Server   | Remove one                       |
| `shortcut clear`                                | Manage Server   | Remove all                       |
