Control Flow
switch
$switch — Switch-case statement for javascript
Switch-case statement for javascript
Syntax
$switch[value;cases]
Parameters
- value (text, required) — The value to match with
- cases (text, required) — The cases to use ($case), use $case[default;…] to add a default case
Return Value
- Unknown.
Usage
$switch[value;cases] → result
Example
$sendMessage[$switch[b;$case[a;one]$case[b;two]]]
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.