Build

Expressions

Inserting data, calculating and formatting with {{ … }}.

Most text, number, toggle, and channel/role/user fields accept expressions written between {{ … }}. Everything outside the braces stays plain text:

Welcome {{ events.<id>.member.displayName }}! You are member number {{ format_number(server.memberCount) }}.
Level {{ floor(actions.<id>.value / 100) }}, account created {{ discord_time(events.<id>.member.createdAt, 'relative') }}

Reading data

An expression reads the data of the current run through a path:

  • events.<id>.<field> — data carried by the Event that triggered the run (who clicked, what was typed...).
  • actions.<id>.<field> — data produced by an Action that already ran (a message it just sent, a channel it just created...).
  • conditions.<id>.result — whether a Condition passed.
  • server.<field> — the server the Blueprint runs in (name, member count, language...), readable anywhere.
  • temp.<name> — a temporary Variable; a server or member Variable is read through the output of the node that read or wrote it, see Variables.

You never type the ids: type {{ in a field and the editor suggests the data available, with its type, then the functions; the Insert a value button next to the field opens the same choice with a search, sorted by node (the nearest first) with an example of each value, and in its tabs the temporary Variables and the functions. A path shows as a chip with the node's name and field. Only nodes that actually run before the one you're editing are offered, following the Blueprint's real connections. The node reference lists every field each node writes.

A chip takes the warning color when its value can be empty: a node that doesn't run on every path, or a field Discord doesn't always send. Double-click it to add a fallback, used when the value is empty, or click Give it a fallback, which wraps it in default(…).

Under a field that holds an expression, the preview shows what it gives on example values, and which examples it used. If empty recomputes it with the values that can be empty left empty, to check the fallback.

Values and operators

  • Text in quotes, 'hello' or "hello"; numbers, 42 or 3.5; true, false, null; lists, ['a', 'b'].
  • Calculations: + - * / %, with parentheses. They only work on numbers: to glue text together, write it outside the braces (Level {{ level }}), not with +.
  • Comparisons: == != < <= > >=, and and, or, not to combine them.

Functions

Functions transform a value: upper(…), round(…), join(…)... The two you'll use most:

  • default(value, fallback) gives the fallback when the value is empty: {{ default(events.<id>.member.voiceChannel.name, 'not in voice') }}.
  • if(condition, then, otherwise) picks a value: {{ if(actions.<id>.value >= 3, 'Last warning', 'Warning') }}.

The function reference lists them all, with an example each. Their names are in English whatever the server's language, so a Blueprint works everywhere.

Types

Every value has a type: text, number, true/false, date, list, record (a member, a channel...) or empty.

  • Calculations need numbers: text holding a number, like an option typed by a member, converts with number(…), and an empty value with default(…, 0).
  • == never converts: '5' == 5 is false.
  • In a text, every value shows as text: numbers and dates in the server's language, lists separated by commas, an empty value as nothing. A whole record (a member, a channel) can't be shown: pick one of its fields.
  • To show a date, prefer discord_time(…): Discord displays it in each reader's own time zone and language. format_date(…) writes it in UTC.

Mentions

A mention written in the text notifies, even when its id comes from an expression: <@{{ events.<id>.member.id }}> pings the member, <@&{{ … }}> the role. A mention that appears inside an inserted value never does: repeating a member's message can't make the bot ping anyone. @everyone and @here only notify when you write them and turn on Allow @everyone and @here on the Action.

Errors

The editor checks every expression before you test or deploy: a typo in a path, an unknown function, a number field that would receive text... The problem is underlined in the field and explained under it. When the fix can't change what you meant (replacing a || b with default(a, b), converting a text with number(…)), a button applies it.

Some problems can only happen while the Blueprint runs, like dividing by zero or reading a date that isn't one. The Action then takes its failure port: error.code says what went wrong, error.message says it in the server's language. See Errors.

To write {{ as plain text in a message, put a backslash before it: \{{.