Conditions, data, and math
Branch on values, keep persistent state, and calculate counters in a visual graph.
If / Else
Select a field or insert a variable, choose an operator, and enter a comparison value. The Yes output runs when it matches; No runs otherwise.
| Operator | Example use |
|---|---|
| Equals | Compare a command option with an exact choice |
| Contains | Check whether message text includes a phrase |
| Exists | Check whether an input has a value |
| Greater than / Less than | Compare a number with a threshold |
| Matches | Match a simple regular expression |
For example, compare {option:topic} with rules, connect Yes to a rules response, and No to a general help response. Prefer numeric fields for numeric comparisons. Keep regular expressions simple; unsupported patterns do not match.
Data
A Data node works with a named persistent value. Choose a key, a data type, and an action:
| Action | Effect |
|---|---|
| Load | Reads the saved value into the current flow |
| Save | Writes the supplied value, or the current loaded value when left blank |
| Delete | Clears the saved value |
Read a loaded value with {store:key}. A number with no saved value loads as 0, a boolean as false, and text as an empty string. Loading first makes the value available to subsequent conditions and calculations.
Include a member ID in a key to keep separate records, such as points_{user.id}. In later text, use {store:points_{user.id}}. Values are separated by bot and runtime server scope; runs in the same server can access the same saved keys. A command's registration scope does not itself create a separate database.
Math
Choose the numeric value to change, an operation, and the other operand. Operations are add, subtract, multiply, divide, and modulo (remainder). Operands can use variables.
Math changes the value in the current flow. Follow it with Data → Save to retain the result for the next invocation. Avoid division by zero; the current result for dividing or taking a remainder by zero is 0.
Example: a personal counter
- Create a
countcommand. - Data → Load the number key
count_{user.id}. - Math → Add
1to that loaded value. - Data → Save the same key, leaving the value blank to save the calculation.
- Send Message with
Your count is {store:count_{user.id}}..
Test the command twice and then with another member. Use load/save counters for simple workflows; simultaneous runs can read the same previous value, so this sequence is not an atomic transaction.
Temporary outputs
Nodes can also produce temporary values, such as an AI reply or an image attachment reference. These are available to later nodes through the output shown in the editor. Temporary values do not become persistent until explicitly saved, and image references should never be saved for later reuse.