Skip to content

Expressions (WIP)

SReject edited this page Feb 9, 2020 · 15 revisions

Expressions are plain-text entered into Firebot that may or may not have special text-sequences that get replaced. Expressions are comprised of text, quoted text, escape tokens and functions that are explained in detail below

Text

Within expressions any text including white space that is not quoted text, an escape token, or part of a function is treated as literal text("as is").

Quoted Text

Quoted text is replaced with its inner text. Quoted text begins and ends with a ". Within quoted text escape sequences are processed but all other text is treat as is. This means that functions will not be processed within quoted text.

If quoted text is started but a closing " is not found, an error will occur.

See Escape Tokens if you need a literal double-quote in your output.

Functions

Functions are tokens that return a result that replaces the token. Functions begin with a $ followed by alphanumeric characters. If the function accepts arguments(parameters), the token is followed by an [, 0 or more comma-separated arguments, then a ]. Each argument can consist of text tokens, quoted tokens, escape tokens, functions or a combination there of.

Within a function's arguments block, white space directly after the [ is ignored, white space directly before and after a comma separator is ignore and white space before the ] is ignored: $var[ a , b ] is treated as $var[a,b]. If you wish to preserve said whitespace, use quoted text: $var[" a "," b "]

The current list of supported functions can be found here

Escape Tokens

Escape tokens are sequences of characters that get replaced with an underlying value. Unlike functions, they alter how the expression is processed.

Sequence Result Notes
\\ \
\$ $ Use to escape what would otherwise be treated as a function start in text
\" " Use to specify a literal double-quote in text and quoted text
\[ [ Use just after a function to include a literal opening bracket
\] ] Use within a function's argument to insert a literal closing bracket

Examples

Big old TODO

Clone this wiki locally