Custom Commands

People ask this as

What this page is

Chat Bot → Chat Commands is where custom text commands live; the page itself is headed Custom Commands, "Manage custom text commands for chat". A command is a trigger the chat types and a response the bot writes back, with variables substituted into it.

How to set it up

The page has two tabs, Commands and Variables, each with its count in brackets. The button at the top right follows the tab you are on — Add Command or Add Variable.

A command

  1. Open Chat Bot → Chat Commands, stay on the Commands tab and press Add Command. The form is titled Create Command.
  2. Command name (for you) — a title you will recognise in the list, and spaces are fine: "My Discord server". Capitals are kept as typed. A single-word name doubles as a trigger in chat; a name with spaces cannot be typed, so such a command needs at least one trigger and saving without one is refused.
  3. Triggers viewers type (comma-separated) — the words that fire the command, the placeholder shows the format: discord, ds. The first one is the main one — it is what the {commands} list shows — while the command answers to all of them. Capitals are kept here too, and a trigger identical to the name is not shown twice on the card.
  4. Trigger ModeMessage starts with !command, or Word anywhere in the message. The second one is marked on the card with a keyword badge.
  5. Command Response — what the bot writes, e.g. "Join our server, {user}!". Under the field stands "Click a variable to insert it into the response:" and a row of chips — {user}, {target}, {args}, {count}, {random:1-100}, {choose:a|b|c}, {randuser}, {time}, {date}, {math:}, {repeat:3:}. A click drops one at the cursor. Three tabs sit above the row — Built-in, Yours and Knowledge Base — so your own variables and your reference links are one click away too.
  6. Cooldown (sec) starts at 10, Per-user Cooldown (sec) at 0. Below them is the tick Moderators and streamer skip cooldown.
  7. Allowed RolesEveryone, Subscriber, VIP, Moderator, Broadcaster. Everyone is ticked on a new command, and ticking nothing at all also saves as Everyone.
  8. Reply only when — a condition, Always by default. The section below explains it.
  9. Press Save, or Cancel. Without a name and a response the form answers "Fill in the command name and response!" and stays open.
  10. A card is headed by the command name alone, with the roles badge beside it and a condition badge when there is one. The line under it holds the aliases, in colour and with their !, followed by the response; then come the cooldown, the per-user cooldown and how many times it has fired. An alias identical to the name is not shown twice. The switch turns the command off without deleting it; beside it are Edit and Delete, and deleting asks "Delete this command?".

A variable of your own

  1. Switch to the Variables tab and press Add Variable — the form is Create Variable.
  2. Variable Name — letters, digits and _ only; the field lowercases what you type and strips the rest. The hint under it shows the result: "Used in responses as {name}".
  3. Values (one per line) — the placeholder shows three lines, pizza, sushi, burger. "A random value from the list is inserted when the command fires".
  4. Press Save. A repeated name is refused with "A variable with this name already exists!", an unfinished form with "Provide a name and at least one value!".
  5. The card shows {name}, how many values it holds and the values themselves. Delete warns first: "Delete this variable? Commands using it will stop substituting it."

Answering only sometimes

Reply only when holds one condition, and Always — no condition — is what a new command gets.

Reply when the condition is not met is the second answer. It takes the same variables and reference links — and its own row of chips, so a click there lands in that field and not in the one above. "No auction right now — next one is on Friday!" is a complete reply. Leave it empty and the command says nothing at all; a silent command does not spend its cooldown, so the next viewer who asks at the right moment still gets an answer.

Saving a game condition with an empty games field is refused: the condition would never match and the command would be silent forever.

Reference links and auction rules

Two more things can be dropped into a response and are kept in one place instead of being retyped.

Braces are single, like every other variable. Double braces {{...}} still work — that was the older spelling, and old texts keep working. Built-in variables are read first, so a reference named time will not shadow the {time} variable; just avoid naming links after variables.

The reference

Variables Reference at the top opens Available Variables — every built-in variable with its meaning and a worked example: {display_name}, {user.id}, {touser}, {args:0|default}, {count+10}, {channel} and the rest, with your own at the end of the list.

What it cannot do