Commands
Commands are a core feature of Nexmod. When a viewer types a trigger word in chat, the bot matches it against your configured commands and executes the associated response or flow.
Anatomy of a Command
Every command in Nexmod has the following properties:
| Property | Description | Default |
|---|---|---|
| Name | The trigger word viewers type in chat (e.g., hello) | Required |
| Enabled | Toggle a command on or off without deleting it | true |
| Match Mode | How the bot matches messages to this command | START |
| Case Sensitive | Whether matching is case-sensitive | false |
| Platform | Which platform the command works on | ALL |
| Allowed Roles | Who can trigger the command | ["everyone"] |
| Global Cooldown | Seconds before anyone can trigger it again | 0 |
| User Cooldown | Seconds before the same user can trigger it again | 0 |
| Response | A simple text response sent to chat | "" |
| Flow Data | A visual flow for advanced command logic | null |
| Aliases | Alternative trigger words for the same command | [] |
| Group | Optional group name for organizing commands | null |
Creating a Command
- Navigate to Commands in the dashboard sidebar
- Click Create Command
- Enter a name — this is the trigger word viewers will type
- The command is created and you’re taken to the editor
Match Modes
Match mode controls how the bot determines whether a chat message should trigger your command.
| Mode | Behavior | Example trigger: hello |
|---|---|---|
| Start | Message must start with the command name | hello world matches, say hello does not |
| Exact | Message must be exactly the command name | hello matches, hello world does not |
| Anywhere | Command name can appear anywhere in the message | Both hello world and say hello match |
| Regex | The name is treated as a regular expression | Full regex pattern matching |
Most commands should use Start mode. This matches the traditional bot command behavior where users type !hello at the beginning of their message. Regex mode is for advanced users who need complex pattern matching.
Platform Targeting
Each command can be scoped to a specific platform:
- All — Works on both Twitch and Discord
- Twitch — Only triggers in Twitch chat
- Discord — Only triggers in Discord
Aliases
Aliases let you define alternative trigger words for the same command. For example, a command named socials could have aliases like twitter, youtube, and instagram — all pointing to the same response.
Aliases follow the same match mode as the parent command.
Permissions
Control who can use each command with role-based permissions. Roles are hierarchical — higher roles inherit access from lower ones.
| Role | Who |
|---|---|
| Everyone | Any viewer in chat |
| Subscriber | Twitch subscribers only |
| VIP | VIPs and above |
| Moderator | Channel moderators and above |
| Broadcaster | Only the channel owner |
When a user without the required role triggers a command, the bot silently ignores it.
Cooldowns
Cooldowns prevent command spam and keep chat clean. There are two types:
Global Cooldown
A shared timer across all users. Once any user triggers the command, nobody can trigger it again until the cooldown expires.
Example: A !clip command with a 30-second global cooldown ensures viewers don’t flood chat with clip requests.
Per-User Cooldown
A per-user timer. After triggering the command, that specific user must wait before using it again, but other users can still use it immediately.
Example: A !points command with a 60-second user cooldown prevents one viewer from spamming it, while other viewers can still check their points.
Set both cooldowns to 0 to disable them entirely. Cooldowns are measured in seconds.
Simple Response
For basic commands, set a text response directly. The bot sends this message in chat when the command is triggered.
Hello {user}! Welcome to the stream.Variables
Use variables in your responses and flow nodes to make them dynamic. Variables are wrapped in curly braces.
Built-in Variables
| Variable | Description | Example Output |
|---|---|---|
{user} | Display name of the user who triggered the command | @viewer123 |
{channel} | The current channel name | mychannel |
{game} | Current stream category | Just Chatting |
{uptime} | How long the stream has been live | 2h 34m |
Counter Variables
Counters are numeric values tied to a command that persist across uses. Access them with {counter:name} syntax.
| Variable | Description | Example |
|---|---|---|
{counter:deaths} | A counter named “deaths” | 42 |
{counter:wins} | A counter named “wins” | 7 |
{count} | Shorthand for the command’s default counter | 15 |
Counters can be incremented, decremented, or set to a specific value using the Update Counter flow node.
Global Variables
Global variables are shared across all commands and actions. Access them with {variable:name}.
| Variable | Description |
|---|---|
{variable:currentSong} | A variable you’ve set elsewhere |
{variable:lastWinner} | Updated by another command or action |
Flow Builder
For advanced command logic, Nexmod provides a visual flow builder. Instead of a single text response, you can create a node-based flow that handles branching, conditionals, data manipulation, and more.
The flow builder is available on the Plus plan and above. Free-tier commands use simple text responses.
How Flows Work
A flow is a directed graph of nodes connected by edges. Execution starts at the Start node and follows the connections through each subsequent node. Some nodes have multiple outputs (like conditionals) which create branching logic.
Node Categories
Start
| Node | Description |
|---|---|
| Start | Entry point — every flow begins here. Fires when the command is triggered. |
Chat
| Node | Description |
|---|---|
| Send Message | Send a message in chat. Supports variables like {user}. |
| Send Reply | Reply directly to the triggering message (threaded reply on Twitch). |
| Whisper | Send a private whisper to the triggering user or a specific username. |
Flow Control
| Node | Description | Outputs |
|---|---|---|
| Cooldown | Rate-limit the command. Configure global and per-user cooldowns. | Pass (allowed) / On Cooldown (blocked) |
| Permission Gate | Check the user’s role before continuing. | Allowed / Denied |
| Conditional | Branch based on a condition (see conditions table below). | Yes / No |
| Delay | Pause execution for 1–300 seconds before continuing. | Next |
| Random | Randomly pick between two output paths. | A / B |
Data
| Node | Description |
|---|---|
| Get Variable | Read a global variable’s current value into the flow. |
| Set Variable | Write a value to a global variable. |
| Get Counter | Read a counter’s current numeric value. |
| Update Counter | Increment, decrement, or set a counter to a specific value. |
| Random Quote | Fetch a random quote from your team’s quote collection. |
| Math | Perform arithmetic: add, subtract, multiply, divide, or modulo. Store the result in a variable. |
Formatting
| Node | Description |
|---|---|
| Format Text | Build dynamic text using a template with variables, e.g., {user} has {counter:deaths} deaths! |
| Regex Match | Test text against a regular expression. Outputs Match or No Match. |
Moderation
| Node | Description |
|---|---|
| Timeout User | Timeout the triggering user for a specified duration (1s–14 days). Optionally include a reason. |
| Purge Messages | Delete the user’s recent messages (1–100 messages). |
Conditional Types
The Conditional node supports these condition checks:
| Condition | Description |
|---|---|
| Message Contains | Check if the chat message contains specific text |
| Message Starts With | Check if the message starts with specific text |
| Message Matches Regex | Test the message against a regular expression |
| User Role Is | Check if the user has a specific role |
| Variable Equals | Compare a global variable to a value |
| Counter Greater Than | Check if a counter exceeds a threshold |
| Counter Less Than | Check if a counter is below a threshold |
| Counter Equals | Check if a counter equals a specific value |
| Random Chance (%) | Randomly pass with a given percentage (e.g., 50% = coin flip) |
| Stream Is Live | Check if the stream is currently live |
Counter Operations
The Update Counter node supports three operations:
| Operation | Description | Example |
|---|---|---|
| Increment | Add to the counter | deaths + 1 → 43 |
| Decrement | Subtract from the counter | deaths - 1 → 41 |
| Set To | Set the counter to a specific value | deaths = 0 |
Math Operations
The Math node supports:
| Operation | Symbol | Example |
|---|---|---|
| Add | + | 10 + 5 = 15 |
| Subtract | − | 10 - 3 = 7 |
| Multiply | × | 4 × 3 = 12 |
| Divide | ÷ | 20 ÷ 4 = 5 |
| Modulo | % | 10 % 3 = 1 |
Both operands can reference counters ({counter:deaths}) or variables ({variable:score}).
Example Flows
Death Counter
A !death command that increments a counter and announces the total:
- Start → Permission Gate (moderator+)
- Permission Gate → (Allowed) → Update Counter (
deaths, increment by 1) - Update Counter → Send Message (
{channel} has died {counter:deaths} times!) - Permission Gate → (Denied) → Send Reply (
Only moderators can update the death counter.)
Random Response
A !8ball command that gives a random answer:
- Start → Random (50/50 split)
- Random → (A) → Send Message (
The magic 8-ball says: Yes!) - Random → (B) → Send Message (
The magic 8-ball says: Ask again later...)
Cooldown with Feedback
A !clip command with feedback when on cooldown:
- Start → Cooldown (30s global)
- Cooldown → (Pass) → Send Message (
Creating a clip for {user}!) - Cooldown → (On Cooldown) → Send Reply (
Clips are on cooldown. Try again in a moment!)
Dashboard Permissions
Managing commands in the Nexmod dashboard requires specific team roles:
| Action | Required Permission |
|---|---|
| View commands | commands:read — Viewer and above |
| Create, edit, delete commands | commands:manage — Editor and above |
Plan Limits
| Plan | Max Commands | Flow Builder |
|---|---|---|
| Free | 15 | No |
| Plus | Unlimited | Yes |
| Pro | Unlimited | Yes |
| VIP | Unlimited | Yes |