Skip to content
Control Flow localFunction

$localFunction — Defines a new local function

Defines a new local function

Syntax

$localFunction[name;code;(params...)]

Parameters

  • name (text, required) — The local function name
  • code (text, required) — The local function code
  • params… (text, optional) — The local function params

Return Value

  • String.

Usage

$localFunction[name;code;(params...)] → result

Example

$sendMessage[$localFunction[double;$calculate[$env[n]*2];n]$callLocalFunction[double;21]]

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.