Chat Effect Variables - crowbartools/Firebot GitHub Wiki
[!CAUTION] The most updated version of this list is available in the bot, click on the blue
$varsbutton in any input field and you will get a list over variables that are specific to the effect/event/trigger.
| Variable | Description |
|---|---|
| $arg[#] | Grabs the command argument (aka a word after the command !trigger) at the given index. |
| Other examples | |
| $arg[1,2] | Grab a range of args. |
| $arg[2,last] | Grab a range of args up to the last arg. |
| $arg[all] | Grab all args. This is a good way to grab all text after the !command trigger. |
| --- | --- |
| $argArray | Returns a JSON array of command arguments |
| $argCount | Returns the number of command args. |
| --- | --- |
| $arrayAdd[jsonArray, newElement] | Returns a new array with the added element |
| Other examples | |
| $arrayAdd["[1,2,3]", 4] | Adds 4 to the end of the array. (1,2,3,4) |
| $arrayAdd["[1,2,3]", 4, true] | Adds 4 to the beginning of the array. (4,1,2,3) |
| --- | --- |
| $arrayFilter[jsonArray, matcher, propertyPath, removeMatches] | Returns a new filtered array. |
| Other examples | |
| $arrayFilter["[1,2,3]", 1, null, false] | Filter out anything that doesn't equal 1 (new array: [1]) |
| $arrayFilter["[1,2,3]", 1, null, true] | Filter out anything that equals 1 (new array: [2,3]) |
| $arrayFilter["[{"username": "ebiggz"},{"username": "MageEnclave"}]", ebiggz, username, true] | Filter out anything that has a username property which equals "ebiggz" (new array: [{"username": "MageEnclave"}]) |
| --- | --- |
| $arrayFind[jsonArray, matcher, propertyPath] | Finds a matching element in the array or null |
| Other examples | |
| $arrayFind["[1,2,3]", 1] | Finds 1 in the array |
| $arrayFind["[{"username": "ebiggz"},{"username": "MageEnclave"}]", ebiggz, username] | Finds object with username of "ebiggz" |
| --- | --- |
| $arrayJoin[jsonArray, separator] | Returns a string with each array item joined together with the given separator |
| $arrayLength[jsonArray] | Returns the length of the input JSON array. |
| $arrayRemove[jsonArray, index] | Returns a new array with the element at the given index removed |
| Other examples | |
| $arrayRemove["[1,2,3]", 0] | Removes the element at the 0 index (2,3) |
| $arrayRemove["[1,2,3]", last] | Removes the element at the last index (1,2) |
| --- | --- |
| $arrayReverse[jsonArray] | Returns a new reversed array |
| $arrayShuffle[jsonArray] | Returns a new shuffled array |
| $bot | Outputs the Bot account username. |
| $capitalize[text] | Capitalizes the given text. |
| $categoryImageUrl | Gets the url for the image url of your last streamed category. |
| Other examples | |
| $categoryImageUrl[$target] | When in a command, gets the image url of the last streamed category for the target channel. |
| $categoryImageUrl[$user] | Gets the image url of the last streamed category for associated user (Ie who triggered command, pressed button, etc). |
| $categoryImageUrl[ebiggz] | Gets the image url of the last streamed category for a specific channel. |
| $categoryImageUrl[ebiggz, 285x380] | Get a different image size (use aspect ratio 4:3). Default is 285x380. |
| --- | --- |
| $ceil[num] | Rounds up the given number to the nearest whole number. |
| $chatMessage | Outputs the chat message from the associated command or event. |
| $chatMessages[username] | Displays the number of chat messages for a viewer (leave blank to use current viewer) |
| $commafy[number] | Adds the appropriate commas to a number. |
| $commandTrigger | The trigger of the issued command. |
| $concat[text, text, ...] | Appends text together |
| $count | Displays the number of times the given command has been run. |
| $counter[name] | Displays the value of the given counter. |
| $currency[currencyName, username] | How much of the given currency the given user has. |
| $currentViewerCount | Get the number of people viewing your stream. |
| $customRoleUserCount[roleName] | Get the number of people in a custom role. |
| $customVariable[name] | Get the data saved in the custom variable. Optionally provide a property path (using dot notation) or array index as a second argument. |
| $date | The current date formatted as MMM Do YYYY |
| Other examples | |
| $date[dddd MMMM Do] | Format with the preferred tokens. |
| $date[MMM Do YYY, 2, days] | Adds 2 days to the current date (or use other units i.e. months, years, etc.). |
| --- | --- |
| $encodeForHtml[text] | Encodes input text for safe use within HTML templates |
| $encodeForUrl[text] | Encodes input text for use in a URL |
| $ensureNumber[input, defaultNumber] | Guarantees a number output. If the input is a number, it's passed through. If it's not, the given default number is used instead. |
| $evalVars[text] | Evaluate $variables in a string of text. Useful for evaluating text $vars from an external source (ie a txt file or API) |
| $fileLineCount["path/to/file.txt"] | Count the number of lines in a text file. |
| $floor[num] | Rounds down the given number to the nearest whole number. |
| $followCount | The number of follows you currently have. |
| Other examples | |
| $followCount[$target] | When in a command, gets the follow count for the target user. |
| $followCount[$user] | Gets the follow count for associated user (Ie who triggered command, pressed button, etc). |
| $followCount[ChannelOne] | Gets the follow count for a specific channel. |
| --- | --- |
| $game | Gets the current game set for your channel |
| Other examples | |
| $game[$target] | When in a command, gets the game set for the target user. |
| $game[$user] | Gets the game set for associated user (Ie who triggered command, pressed button, etc). |
| $game[ChannelOne] | Gets the game set for a specific channel. |
| --- | --- |
| $loopCount | 0 based count for the current loop iteration inside of a Loop Effects effect |
| $loopItem | The item for current loop iteration inside of a Loop Effects effect using Array loop mode |
| $lowercase[text] | Makes the entire given text string lowercase. |
| $math[expression] | Evaluate a math equation |
| $max[num1, num2, ...] | Returns the highest-value numbered passed |
| $min[num1, num2, ...] | Returns the lowest-value numbered passed |
| $obsSceneName | The name of the current OBS Scene. If OBS isn't running, it returns 'Unknown'. |
| $ordinalIndicator[number] | Adds an ordinal indicator suffix to a number (ie 'st', 'nd', 'rd') |
| $profilePageBytebinToken | Get bytebin id to access allowed commands for a user. Access the json by going to https://bytebin.lucko.me/ID-HERE. |
| $quote | Get a random quote |
| Other examples | |
| $quote[#] | Get a specific quote id. |
| --- | --- |
| $randomActiveViewer | Get a random active chatter. |
| Other examples | |
| $randomActiveViewer[roleName] | Filter to an active viewer in a specific role. |
| $randomActiveViewer[null, ignoreUser] | Get a random active user that is NOT the ignore user |
| --- | --- |
| $randomAdvice | Get some random advice! |
| $randomDadJoke | Get a random dad joke! |
| $randomNumber[min, max] | Get a random number between the given range. |
| $randomRedditImage[subredditName] | Get a random image from a subreddit. (We do our best to check for bad images, but content warning none the less.) |
| $randomViewer | Get a random viewer in chat. |
| $readApi[url] | Calls the given url and inserts the response. |
| Other examples | |
| $readApi[url, object.path.here] | Traverse a JSON response object. |
| $readFile[path\to\file.txt] | Read contents of a text file. |
| Other examples | |
| $readFile[path\to\file.txt, 1] | Read a specific line number from the file. |
| $readFile[path\to\file.txt, last] | Read the last line from the file. |
| $readFile[path\to\file.txt, random] | Read a random line from the file. |
| --- | --- |
| $regexExec[string, expression] | Filter a string with a regular expression |
| Other examples | |
| $regexExec[string, expression, flags] | Add flags to the regex evaluation. |
| --- | --- |
| $regexTest[string, expression] | Check whether a string matches a regular expression |
| Other examples | |
| $regexTest[string, expression, flags] | Add flags to the regex evaluation. |
| --- | --- |
| $replace[textInput, searchValue, replacement] | Replaces a search value with a replacement value |
| Other examples | |
| $replace[textInput, searchValue, replacement, true] | Allows searching using a regular expression. |
| $replace[textInput, searchValue, replacement, true, flags] | Add flags when using a regular expression. |
| --- | --- |
| $round[num] | Rounds the given number to the nearest whole number. |
| $scrambleText[text] | Scrambles the input text |
| $splitText[text, separator] | Splits text with the given separator and returns a JSON array. Useful for Custom Variables. |
| $streamAudience | Gets the audience level (Family Friendly/Teen/18+) set for your channel |
| Other examples | |
| $streamAudience[$target] | When in a command, gets the audience level set for the target user. |
| $streamAudience[$user] | Gets the audience level set for associated user (Ie who triggered command, pressed button, etc). |
| $streamAudience[ChannelOne] | Gets the audience level set for a specific channel. |
| --- | --- |
| $streamer | Outputs the Streamer account username. |
| $streamTitle | Gets the current stream title for your channel |
| Other examples | |
| $streamTitle[$target] | When in a command, gets the stream title for the target channel. |
| $streamTitle[$user] | Gets the stream title for associated user (Ie who triggered command, pressed button, etc). |
| $streamTitle[ebiggz] | Gets the stream title for a specific channel. |
| --- | --- |
| $subCount | The number of subs you currently have. |
| $subPoints | The number of sub points you currently have. |
| $target | Similar to the $arg variable but strips out any leading '@' symbols. Useful when the argument is expected to be a username. |
| Other examples | |
| $target[#] | Grab the target at the given index (IE with '!command @ebiggz @TheLastMage', $target[2] would be 'TheLastMage') |
| --- | --- |
| $textContains[text, search] | Returns true if text contains search, otherwise returns false |
| $textLength[text] | Returns the length of the input text |
| $textSubstring[text, start, end] | Returns a substring of the provided text based on the range |
| $time | Outputs the current time. |
| $topCurrency[currencyName] | Comma seperated list of users with the most of the given currency. Defaults to top 10, you can provide a custom number as a second argument. |
| $topCurrencyUser[currencyName, position, username/amount] | Get the username or amount for a specific position in the top currency |
| Other examples | |
| $topCurrencyUser[Points, 1, username] | Get the top Points username |
| $topCurrencyUser[Points, 5, amount] | Get the top Points amount at 5th position |
| --- | --- |
| $topViewTime[count] | Comma seperated list of users with the most view time (in hours). Defaults to top 10, you can provide a custom number as a second argument. |
| $trim[text] | Removes any whitespace from the beginning and end of input text. |
| $uppercase[text] | Makes the entire given text string uppercase. |
| $uptime | The current stream uptime |
| $user | The associated user (if there is one) for the given trigger |
| $userAvatarUrl | Gets the url for the avatar to the current user. Optionally pass in a username. |
| $userExists[username] | Outputs 'true' if a user exists in Firebot's database, 'false' if not |
| $userMetadata[username, metadataKey] | Get the metadata associated with the user. |
| Other examples | |
| $userMetadata[username, metadataKey, defaultValue] | Provide a default value if one doesn't exist for the user. |
| $userMetadata[username, metadataKey, null, propertyPath] | Provide a property path (using dot notation) or array index as a second argument. |
| --- | --- |
| $username | The associated user (if there is one) for the given trigger. Alternative to $user |
| $usernameArray | Returns a JSON array of all usernames saved in the user db |
| $viewTime[username] | Displays the view time (in hours) of a given viewer (leave blank to use current viewer) |