Skip to main content

Logic and randomness

Branch on conditions with if/elseif/else and roll random values inside a response.
Conditionals and random tags run inside the core scripting engine, so they work in custom commands and anywhere else raze accepts a script.

Conditionals

{/if} is an alias for {endif}, and the colon is optional ({if CONDITION} also parses).
1

Start with a single branch

2

Add an else

3

Chain more cases with elseif

silver

Condition types

Operators: ==, !=, >=, <=, >, <.If both sides parse as numbers they are compared numerically; otherwise they are compared as text.
Case-insensitive substring test.
Accepts a role mention, a role ID, or a role name.
Accepts any Discord permission name in any casing — ManageMessages, manage_messages, and Manage Messages all resolve to the same permission.
A bare value is true unless it is empty or one of false, none, n/a (any casing, surrounded whitespace ignored). exists (value) does the same check explicitly.
Variables are substituted before conditions are evaluated, which is why {if:{score}>=100} works. By evaluation time a condition should contain no leftover { } — an unresolved variable inside a condition breaks the block.
Database tags resolve after conditionals, so {db.get:...} and {db.exists:...} cannot be tested inside a condition.
Blocks may nest up to 20 levels deep, and a single script may contain at most 500 conditional tags. Past either limit the remaining tags are left as-is instead of being evaluated.

Random values

Reusing a rolled value

Plain {choose} and {range} reroll on every occurrence. Use the named forms when the same result has to appear more than once — including inside a condition.
You got heads! That’s lucky.
{range} bounds must be literal digits. Random tags resolve before argument substitution, so {range:1-{sides}} never rolls — it renders as plain text. Branch on the argument instead:
Saved names may contain letters, digits, _, ., and -. A saved value replaces every {name} that appears anywhere later in the script.