Skip to content
Control Flow checkCondition

$checkCondition — Inline Condition Evaluation

$checkCondition[condition] takes a single argument, a condition, evaluates it and returns the string "true" or "false". Unlike the $if structural token, $checkCondition is a standard function call that can be used anywhere a string value is expected — inside $if conditions, combined with $and/$or, or assigned to variables.

Syntax

$checkCondition[condition]

The condition is one expression: either the literal true / false, or left<operator>right (for example $getUserVar[coins]>100). The call requires exactly one argument.

Operators

All six standard comparison operators are supported:

Operator Meaning
== Equal to
!= Not equal to
> Greater than
< Less than
>= Greater or equal
<= Less or equal

Both sides are trimmed. If both sides are finite decimal numbers (12, -3.5, 1e3), they are compared numerically and exactly, with no rounding (12345678901234567890==12345678901234567891 is false); otherwise, hexadecimal such as 0x10 included, they are compared as text, character code by character code (so B<a is true: uppercase letters sort before lowercase ones). The operator is searched by priority: == and != first, then >= and <=, then > and <; the earliest occurrence of the highest-priority pair splits the text. The < and > of a Discord mention, emoji, timestamp or command link (<@123>, <#123>, <a:name:123>, <t:123>) are part of the value, not operators. A condition that is neither true, false nor a comparison (including a single =, or an empty condition) raises the error Invalid condition: <condition>.

Return Value

$checkCondition always returns the literal strings "true" or "false" (lowercase). These are string values, not boolean primitives. In an $if, both forms work, since true and false are accepted as conditions:

$if[$checkCondition[$getUserVar[gold]>0]]
$if[$checkCondition[$getUserVar[gold]>0]==true]

Comparison with Direct Conditions in $if

You can write conditions inside $if directly (e.g., $if[$getUserVar[gold]>0]) without using $checkCondition. The main reasons to use $checkCondition are:

  1. Composability — pass the result to $and / $or or store it in a variable.
  2. Clarity — makes the comparison intent explicit, especially with complex expressions.
  3. Reuse — evaluate once and reuse the result in multiple places.

Common Pitfalls

  • Using a single = instead of == — BibiScript requires double equals for equality.
  • Expecting boolean-like truthiness — $checkCondition returns a string (true or false); an empty or otherwise non-comparison argument is an error, not false.
  • Passing the operator as a separate argument ($checkCondition[>;a;b]): the function takes exactly one argument.

Examples

Evaluating a Numerical Threshold

$title[Condition Evaluation]
$description[Is user balance greater than 100? **$checkCondition[$getUserVar[coins]>100]**]
$color[#5865F2]

Try it

Paste an example into the playground to preview its message (functions that act on Discord are not run), or build the same thing with blocks.