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

# Response

> Create a trigger to automatically respond to a specific message.

<Note>Haunt's prefix is set to `;` by default.</Note>
<Info>Use `;prefix set [character]`to change the prefix for your server.</Info>

## Creating a new response trigger

Get started by using the `response create` command.

<Warning>The **trigger** and **response** must be separated by a comma (`,`).</Warning>
<Note>You can use [**Embeds**](/resources/embeds/scripting) and [**Variables**](/resources/embeds/variables) while creating a response as well.</Note>

<CodeGroup>
  ```javascript Syntax theme={null}
  ;response create (trigger, response) [{flags}]
  ```

  ```javascript Example theme={null}
  ;response create read the docs, https://docs.haunt.site
  ;response create read the docs, {"embeds":[{"description":"read the docs {user}","color":9716547}]}
  ```

  ```javascript Flags theme={null}
  ;response create read the docs, https://docs.haunt.site {reply}
  ;response create read the docs, https://docs.haunt.site {loose}
  ;response create read the docs, https://docs.haunt.site {delete: 5s}
  ```
</CodeGroup>

<br />

<Frame>
  <img src="https://mintcdn.com/haunt-74016d1b/ASiqH9pmjssEViAC/images/configuration/messages/responder/create.png?fit=max&auto=format&n=ASiqH9pmjssEViAC&q=85&s=ec766cb892184e2257713b707c34d198" width="669" height="180" data-path="images/configuration/messages/responder/create.png" />
</Frame>

### What flags can I use with responders

Here are the flags that are available for creating responses

<AccordionGroup>
  <Accordion title="Loose Match">
    The `{loose}` flag will search for the trigger anywhere in the message.<br />
    For example, if the trigger is `bhisa`, **haunt** will respond to `bhisa is cool`.
  </Accordion>

  <Accordion title="Replying to a trigger">
    The `{reply}` flag will reply to the trigger message.
  </Accordion>

  <Accordion title="Automatically delete the response">
    The `{delete}` flag will delete the response after a certain amount of time.<br />
    <Info>To use the delete flag you **HAVE** to provide a time frame, Example: `{duration: 10s}`</Info>
  </Accordion>
</AccordionGroup>

## Delete an existing response trigger

Delete an existing response trigger by using the `response delete` command.

<CodeGroup>
  ```javascript Syntax theme={null}
  ;response delete (trigger)
  ```

  ```javascript Example theme={null}
  ;response delete read the docs
  ```
</CodeGroup>

<br />

<Frame>
  <img src="https://mintcdn.com/haunt-74016d1b/0oTPWE6m-gaDT6d9/images/configuration/messages/responder/delete.png?fit=max&auto=format&n=0oTPWE6m-gaDT6d9&q=85&s=8776a096e566c3f698a6f7b683bd4f35" width="556" height="194" data-path="images/configuration/messages/responder/delete.png" />
</Frame>

## View every existing response trigger

<CodeGroup>
  ```javascript Syntax theme={null}
  ;response view [trigger]
  ```

  ```javascript Example theme={null}
  ;response view hi zay
  ```
</CodeGroup>

## Remove every existing response

<CodeGroup>
  ```javascript Syntax theme={null}
  ;response clear
  ```

  ```javascript Example theme={null}
  ;response clear
  ```
</CodeGroup>

## Update an existing response trigger

Here are the following subcommands to update settings for a response trigger.

<AccordionGroup>
  <Accordion title="Message">
    This command will update the message which triggers the response.<br />
    <Warning>The **message** and the **new message** must be separated with a **comma** (`,`).</Warning>

    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response update message (message), (new message)
      ```

      ```javascript Example theme={null}
      ;response update message hi zay, hello zay
      ```
    </CodeGroup>

    <Frame>
      <img src="https://mintcdn.com/haunt-74016d1b/0oTPWE6m-gaDT6d9/images/configuration/messages/responder/update-message.png?fit=max&auto=format&n=0oTPWE6m-gaDT6d9&q=85&s=755e21d537b2a41d0fa58bf5cfc2c2d1" width="553" height="292" data-path="images/configuration/messages/responder/update-message.png" />
    </Frame>
  </Accordion>

  <Accordion title="Response">
    This command will update the response that sends when it's triggered.<br />
    <Warning>The **message** and the **response** must be separated with a **comma** (`,`).</Warning>

    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response update response (message), (response)
      ```

      ```javascript Example theme={null}
      ;response update response hi zay, shut up
      ```
    </CodeGroup>

    <Frame>
      <img src="https://mintcdn.com/haunt-74016d1b/0oTPWE6m-gaDT6d9/images/configuration/messages/responder/update-response.png?fit=max&auto=format&n=0oTPWE6m-gaDT6d9&q=85&s=7c33d2352533308ae19fd586e80a364e" width="484" height="312" data-path="images/configuration/messages/responder/update-response.png" />
    </Frame>
  </Accordion>

  <Accordion title="Loose">
    This command updates the loose setting for the response.<br />
    <Warning>The **message** and the **choice** must be separated with a **comma** (`,`).</Warning>

    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response update loose (message), (choice)
      ```

      ```javascript Example theme={null}
      ;response update loose hi zay, false
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Reply">
    This command updates the reply setting for the response.<br />
    <Warning>The **message** and the **choice** must be separated with a **comma** (`,`).</Warning>

    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response update reply (message), (choice)
      ```

      ```javascript Example theme={null}
      ;response update reply hi zay, yes
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Cooldown">
    This command updates the cooldown setting for the response.<br />
    <Warning>The **message** and the **duration** must be separated with a **comma** (`,`).</Warning>

    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response update cooldown (message), (duration)
      ```

      ```javascript Example theme={null}
      ;response update cooldown hi zay, 5 minutes
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Prompt">
    This command updates the prompt setting for the response.<br />
    <Warning>The **message** and the **choice** must be separated with a **comma** (`,`).</Warning>

    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response update prompt (message), (choice)
      ```

      ```javascript Example theme={null}
      ;response update prompt hi zay, true
      ```
    </CodeGroup>

    Turning on the prompt setting repeats what you say after triggering the response.<br />

    <Frame>
      <img src="https://mintcdn.com/haunt-74016d1b/0oTPWE6m-gaDT6d9/images/configuration/messages/responder/prompt.png?fit=max&auto=format&n=0oTPWE6m-gaDT6d9&q=85&s=cc3201944ec208fbaed0d7496ada4644" width="487" height="300" data-path="images/configuration/messages/responder/prompt.png" />
    </Frame>
  </Accordion>

  <Accordion title="Delete">
    This command deletes the response that gets sent.<br />
    <Warning>The **message** and the **duration** must be separated with a **comma** (`,`).</Warning>

    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response update delete (message), (duration)
      ```

      ```javascript Example theme={null}
      ;response update delete hi zay, 3 seconds
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Delete Trigger">
    This command will delete the message that triggered the response.<br />
    <Warning>The **message** and the **duration** must be separated with a **comma** (`,`).</Warning>

    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response update delete trigger (message), (duration)
      ```

      ```javascript Example theme={null}
      ;response update delete trigger hi zay, 3 seconds
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Match">
    This command updates the match setting for the message.<br />
    <Warning>The **message** and the **match** must be separated with a **comma** (`,`).</Warning>

    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response update match (message), (start|exact|end)
      ```

      ```javascript Example theme={null}
      ;response update match hi zay, start
      ```
    </CodeGroup>

    Start means the message trigger has to be at the start of the message.<br />

    <Frame>
      <img src="https://mintcdn.com/haunt-74016d1b/0oTPWE6m-gaDT6d9/images/configuration/messages/responder/start.png?fit=max&auto=format&n=0oTPWE6m-gaDT6d9&q=85&s=3bcd139b7bf4efbb67273897b756f5e6" width="516" height="318" data-path="images/configuration/messages/responder/start.png" />
    </Frame>

    Exact makes the message trigger work as normal.<br />

    <Frame>
      <img src="https://mintcdn.com/haunt-74016d1b/0oTPWE6m-gaDT6d9/images/configuration/messages/responder/exact.png?fit=max&auto=format&n=0oTPWE6m-gaDT6d9&q=85&s=0d95a255ab911c761b65d35c3a5b4cfb" width="511" height="344" data-path="images/configuration/messages/responder/exact.png" />
    </Frame>

    End means the message trigger has to be at the end of the message.

    <Frame>
      <img src="https://mintcdn.com/haunt-74016d1b/0oTPWE6m-gaDT6d9/images/configuration/messages/responder/end.png?fit=max&auto=format&n=0oTPWE6m-gaDT6d9&q=85&s=cc3a968d7f8766bfed1cd3cde4b5cb82" width="506" height="319" data-path="images/configuration/messages/responder/end.png" />
    </Frame>
  </Accordion>
</AccordionGroup>

## Restrict a response to a role

Start by using the `response role` command.

<CodeGroup>
  ```javascript Syntax theme={null}
  ;response role add (message), (role)
  ```

  ```javascript Example theme={null}
  ;response role add hi zay, @haunt
  ```
</CodeGroup>

<AccordionGroup>
  <Accordion title="Remove a response from a restricted role">
    <Warning>The **message** and the **role** must be separated with a **comma** (`,`).</Warning>

    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response role remove (message), (role)
      ```

      ```javascript Example theme={null}
      ;response role remove hi zay, @haunt
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="View the respones restricted to roles">
    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response role view
      ```

      ```javascript Example theme={null}
      ;response role view
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Clear every response restricted to a role">
    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response role clear
      ```

      ```javascript Example theme={null}
      ;response role clear
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

## Restrict a response to a channel

Start by using the `response channel` command.

<CodeGroup>
  ```javascript Syntax theme={null}
  ;response channel add (message), (channel)
  ```

  ```javascript Example theme={null}
  ;response channel add hi zay, #commands
  ```
</CodeGroup>

<AccordionGroup>
  <Accordion title="Remove a response from a restricted channel">
    <Warning>The **message** and the **channel** must be separated with a **comma** (`,`).</Warning>

    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response channel remove (message), (channel)
      ```

      ```javascript Example theme={null}
      ;response channel remove hi zay, #commands
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="View the respones restricted to channels">
    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response channel view
      ```

      ```javascript Example theme={null}
      ;response channel view
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Clear every response restricted to a channel">
    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response channel clear
      ```

      ```javascript Example theme={null}
      ;response channel clear
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

## What else can I do?

You can also entirely ignore a `member`, `role` or `channel` from triggering responses.<br />

### Ignore a member

<CodeGroup>
  ```javascript Syntax theme={null}
  ;response ignore (member)
  ```

  ```javascript Example theme={null}
  ;response ignore @bhisa
  ```
</CodeGroup>

<AccordionGroup>
  <Accordion title="Remove a member from being ignored">
    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response ignore remove (member)
      ```

      ```javascript Example theme={null}
      ;response ignore remove @bhisa
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="View every member being ignored">
    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response ignore view
      ```

      ```javascript Example theme={null}
      ;response ignore view
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Clear every member being ignored">
    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response ignore clear
      ```

      ```javascript Example theme={null}
      ;response ignore clear
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

### Ignore a role

<CodeGroup>
  ```javascript Syntax theme={null}
  ;response ignore role (role)
  ```

  ```javascript Example theme={null}
  ;response ignore role @haunt
  ```
</CodeGroup>

<AccordionGroup>
  <Accordion title="Remove a role from being ignored">
    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response ignore role remove (role)
      ```

      ```javascript Example theme={null}
      ;response ignore role remove @haunt
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="View every role being ignored">
    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response ignore role view
      ```

      ```javascript Example theme={null}
      ;response ignore role view
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Clear every role being ignored">
    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response ignore role clear
      ```

      ```javascript Example theme={null}
      ;response ignore role clear
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>

### Ignore a channel

<CodeGroup>
  ```javascript Syntax theme={null}
  ;response ignore channel (channel)
  ```

  ```javascript Example theme={null}
  ;response ignore channel #general
  ```
</CodeGroup>

<AccordionGroup>
  <Accordion title="Remove a channel from being ignored">
    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response ignore channel remove (channel)
      ```

      ```javascript Example theme={null}
      ;response ignore channel remove #general
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="View every channel being ignored">
    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response ignore channel view
      ```

      ```javascript Example theme={null}
      ;response ignore channel view
      ```
    </CodeGroup>
  </Accordion>

  <Accordion title="Clear every channel being ignored">
    <CodeGroup>
      ```javascript Syntax theme={null}
      ;response ignore channel clear
      ```

      ```javascript Example theme={null}
      ;response ignore channel clear
      ```
    </CodeGroup>
  </Accordion>
</AccordionGroup>
