Skip to content

Replace Variables

Dennis Rijsdijk edited this page May 18, 2024 · 10 revisions

Stream Deck Replace Variables

The Firebot Stream Deck Plugin exposes a subset of replace variables from Firebot.
Replace variables can currently only be used in action titles, not in values.

As of version 0.3.0.0, the following variables are available:

Data Variables

Format Variables

These variables are used to format data in specific ways.

  • $formatSeconds[seconds, alwaysShowHours = $false]
    • Formats seconds to a human-readable string with the highest unit being hours, eg. HHH:MM:SS, HH:MM:SS, MM:SS
    • When alwaysShowHours is false and the time is less than 1 hour, only MM:SS will be shown (eg. 12:30). When true, the time is padded (eg. 00:12:30)

Firebot Variables

These variables work identically between Firebot and the Stream Deck Plugin

  • $math[expression]
    • Evaluate a math equation using math.js

  • $true
    • Returns a literal true value; Useful in comparisons such as in $if[]

  • $false
    • Returns a literal false value; Useful in comparisons such as in $if[]

  • $null
    • Returns a literal null value; Useful in comparisons such as in $if[]

  • $if[condition, when_true, when_false]
    • Returns the parameter based on the condition's result.

  • $ALL[condition, condition, ...]
  • $AND[condition, condition, ...]
    • Returns $true if all of the conditions return true.

  • $ANY[condition, condition, ...]
  • $OR[condition, condition, ...]
    • Returns $true if any of the conditions return $true

  • $NALL[condition, condition, ...]
  • $NAND[condition, condition, ...]
    • Returns $true if any of the conditions return $false.

  • $NANY[condition, condition, ...]
  • $NOR[condition, condition, ...]
    • Returns $true if all conditions return $false

  • $NOT[condition]
    • Returns the opposite of the condition's result. eg. $true becomes $false