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
Comparisons
Comparisons
Operators:
==, !=, >=, <=, >, <.If both sides parse as numbers they are compared numerically; otherwise they are compared as text.contains
contains
Case-insensitive substring test.
user has role
user has role
Accepts a role mention, a role ID, or a role name.
user has permission
user has permission
Accepts any Discord permission name in any casing —
ManageMessages, manage_messages, and Manage Messages all resolve to the same permission.Truthiness
Truthiness
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.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.
Saved names may contain letters, digits,
_, ., and -. A saved value replaces every {name} that appears anywhere later in the script.
