*ī¸âŖOperators
Fluff operators
Math operators
Following math operators are supported if you need to do any calculations in your bots:
Operator | Operation (for numbers) | Operation (for strings) |
---|---|---|
+ | Addition | Concatenation |
- | Subtraction | - |
* | Multiplication | - |
/ | Division | - |
Mixing token and USD prices together in calculations is forbidden
Doing calculations on incompatible types (or dividing by zero) will make the condition evaulate to false
Comparison operators
Following comparison operators are supported:
Operator | Meaning | Sample use |
---|---|---|
< | Less than | 1 < 2 |
<= | Less than or equal | 1 <= 1 |
== | Equal | "a" == "a" 1 == 1 |
!= | Not equal | "a" != "b" 1 != 2 |
>= | Greater than or equal | 1 >= 1 |
> | Greater than | 2 > 1 |
in | Included in a list | 1 in [1, 2] "a" in ["a", "b"] |
not in | Not included in a list | 1 not in [2, 3] "a" not in ["b", "c"] |
Logical operators
Following logical operators are supported:
Operator | Description | Sample use |
---|---|---|
and | Returns true if both statements are true | 1 < 2 and 1 < 3 |
or | Returns true if at least one of the statements is true | 1 < 2 or 1 < 1 |
not | Inverts the condition result | not (1 == 2) |
It's advised to use parenthesis whenever you mix "and" and "or" operators together, so it's clear which operator has higher precedence. So instead of writing "... and ... or ..." please write "... and (... or ...)".
Last updated