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

# Twitch Chat Commands

> Create custom chat commands for your Twitch channel. Auto-respond to viewers and control overlays from chat.

## Chat Commands

Create commands that viewers can trigger by typing in chat. Commands can respond with messages, control your overlays, or perform other actions.

***

## Creating a Command

<Steps>
  <Step title="Go to Chatbot">
    In the dashboard sidebar, click **Chatbot**
  </Step>

  <Step title="Click Commands">
    Select the **Commands** tab
  </Step>

  <Step title="Create Command">
    Click **Create Command**
  </Step>

  <Step title="Set the trigger">
    Enter the command trigger (e.g., `!discord`, `!socials`)
  </Step>

  <Step title="Configure response">
    Set what happens when the command is used
  </Step>

  <Step title="Save">
    Save your command
  </Step>
</Steps>

***

## Command Settings

### Trigger

The word or phrase that activates the command:

* Must start with a prefix (usually `!`)
* Example: `!discord`, `!death`, `!song`

### Aliases

Alternative triggers for the same command:

* Add multiple ways to trigger
* Example: `!dc` as an alias for `!discord`

### Response

What the bot posts in chat:

* Plain text responses
* Dynamic variables
* Rich formatting

***

## Dynamic Variables

Use variables in responses for dynamic content:

| Variable    | Output                             |
| ----------- | ---------------------------------- |
| `{user}`    | Username who triggered the command |
| `{channel}` | Channel name                       |
| `{game}`    | Current game being played          |
| `{title}`   | Stream title                       |
| `{uptime}`  | How long the stream has been live  |
| `{viewers}` | Current viewer count               |

**Example:**

```
Thanks for watching {user}! We're playing {game} today.
```

***

## Overlay Actions

Commands can control overlay layers:

### Modify Counters

```
Trigger: !death
Action: Add 1 to death counter layer
Response: "Death counter updated!"
```

### Control Timers

```
Trigger: !pause
Action: Pause the countdown timer
Response: "Timer paused"
```

### Trigger Rotations

```
Trigger: !nextlogo
Action: Advance logo rotation
```

<Steps>
  <Step title="Create command">
    Set up the trigger and response
  </Step>

  <Step title="Add action">
    Click **Add Action**
  </Step>

  <Step title="Select overlay">
    Choose the overlay containing the layer
  </Step>

  <Step title="Select layer">
    Choose which layer to control
  </Step>

  <Step title="Configure action">
    Set what happens (add, subtract, set, toggle, etc.)
  </Step>
</Steps>

***

## Permissions

### Role Requirements

| Permission      | Who can use      |
| --------------- | ---------------- |
| **Everyone**    | Any viewer       |
| **Subscriber**  | Subscribers only |
| **VIP**         | VIPs only        |
| **Moderator**   | Moderators only  |
| **Broadcaster** | Only you         |

### User Lists

**Whitelist** - Only these users can use the command
**Blacklist** - These users cannot use the command

***

## Cooldowns

Prevent spam by adding cooldowns:

### Global Cooldown

* Applies to everyone
* No one can use until cooldown expires
* Example: 30 second global cooldown

### Per-User Cooldown

* Each user has their own timer
* Others can use while one user is on cooldown
* Example: 60 second per-user cooldown

***

## Examples

### Social Links Command

```
Trigger: !socials
Response: "Follow me! Twitter: @username | Discord: discord.gg/xxx | YouTube: youtube.com/xxx"
```

### Death Counter Command

```
Trigger: !death
Action: Add 1 to score layer
Response: "RIP! Death count: {score}"
Permissions: Moderators only
```

### Song Request Info

```
Trigger: !song
Response: "Current song info will appear here"
Cooldown: 30 seconds global
```

***

## Tips

<Tip>
  **Use clear trigger names** - `!discord` is better than `!d` for discoverability.
</Tip>

<Tip>
  **Add aliases** for common misspellings or abbreviations.
</Tip>

<Tip>
  **Set appropriate cooldowns** - Popular commands need longer cooldowns to prevent spam.
</Tip>

<Tip>
  **Test commands offline** before your stream to ensure they work correctly.
</Tip>
