From f11ca94c36ede607713b856fb700aa70010c386e Mon Sep 17 00:00:00 2001 From: Oshimia <120189186+Oshimia@users.noreply.github.com> Date: Fri, 21 Feb 2025 00:54:33 +0700 Subject: [PATCH 1/4] Adding a guide for evalJs effect and variable. --- .../v5/guides/evaluate-javascript/page.mdx | 46 +++++++++++++++++++ src/navigation.ts | 1 + 2 files changed, 47 insertions(+) create mode 100644 src/app/v5/guides/evaluate-javascript/page.mdx diff --git a/src/app/v5/guides/evaluate-javascript/page.mdx b/src/app/v5/guides/evaluate-javascript/page.mdx new file mode 100644 index 0000000..d2dbb37 --- /dev/null +++ b/src/app/v5/guides/evaluate-javascript/page.mdx @@ -0,0 +1,46 @@ +## Evaluate JavaScript effects and variables. + +Firebot will allow you to run JS (JavaScript) code to process information more programmatically than using the UI and built in effects. The JS code will run in a limited sandbox to make sure it doesn't affect any other Firebot systems, and will only run for a maximum of 5 seconds, after which point it will terminate. This means that it's very useful but cannot be used to, for example, run a HTTP request to contact an API, or process extremely large amounts of data. These limitations aside it is very useful for processing text and information more directly and easily than working with the Firebot UI. + +There are two methods for using evalJs. You can use an Evaluate JavaScript effect, like a chat effect or play sound effect that you may be more familiar with, or you can use an evalJs variable, like the `$user` or `$chatMessage` variables that you may be using already. We'll explain the effect first, and then the variable afterwards. + +**Evaluate JavaScript Effect** +To use an Evaluate JavaScript effect click "Add New Effect" in any effect list. Remember that for commands you will need the UI set to "Advanced" to access this. When the "Select New Effect" menu pops up make sure your category is set to "All" or "Advanced" and in the search bar at the top type "eval". This should bring up the Evaluate Javascript effect for you to select. + +Once you select this it should bring up the Edit Effect UI. You will have a large text box for Code, and a separate section for Parameters. In order to get information into the effect you will save it as a parameter. You can use variables in parameters, which means you can pass custom data saved as custom variables, you can learn more about them here: https://docs.firebot.app/v5/guides/custom-variables. For now we're just going to save something very basic, click on the `+` sign underneath Parameters and when it asks you to add text just add the number `1`. You should now have this saved as `parameters[0]`. Let's add one more parameter by again clicking on the plus sign and this time saving `2`. We now have `parameters[0]` and `parameters[1]`. + +Now lets access that data in the code section. At the top of the code section (where it's easy to find if you need to edit it later) write the following +``` +let firstNum = parameters[0]; +let secondNum = parameters[1]; +``` +This means we have now saved the data in the parameters into the code section, and can access it by using the `firstNum` and `secondNum` variables. so let's write some basic code to process it, in this case we'll just write `let sum = firstNum + secondNum;` which will add the firstNum and secondNum variables together and save it as a third variable `sum`. + +Now we need to get the data out of the effect, and to do this we need to use `return` to tell the code what data to return to Firebot. So our code section now looks like this: +``` +let firstNum = parameters[0]; +let secondNum = parameters[1]; + +let sum = firstNum + secondNum; + +return sum +``` + +1+2=3 so this will return 3, now we just need to access this. At the very bottom of the Edit Effect UI you can see `[→ Outputs` in blue if we click on this we can see `$effectOutput[jsResult]`. This is a variable that we can use elsewhere in Firebot. We can also click on the little edit symbol to edit what it's called. If you plan on using multiple evalJs effects it's a good idea to rename this to avoid multiple effects accidentally saving data over each others effects. so let's call this one "sum". Edit the name to "sum", click save, and now you will see it's called `$effectOutput[sum]`. You can now write this into any text box in Firebot that accepts variables, and it will convert to the result of the Evaluate JavaScript effect, in this case `3`. + +**evalJs variable** +You can also write JS into any text box that will accept the evalJs variable. You can find this by clicking on the blue `$vars` button that you can find in almost all the text boxes in Firebot and typing "eval" into the search bar that comes up. It will show you `$evalJs[`` code ``, ...parameters]`. This works in a very similar way to the Evaluate JavaScript effect, you write the JS code between the two bacticks, and you add the data at the end of variable as parameters. So our little script will look like this: +``` +$evalJs[`` +let firstNum = parameters[0]; +let secondNum = parameters[1]; + +let sum = firstNum + secondNum; + +return sum`` +, 1, 2] +``` + +This will give us exactly the same result as the effect we made earlier, but this will do it in place. Meaning we do not need to use the `$effectOutput[jsResult]` variable. It will replace the evalJs variable with whatever we return from that variable. + +The evalJs effect and variable are very powerful ways to process data, they can cut out a lot of other effects (like multiple conditional effects that can all be written into a simple JS script) and simplify your commands and effects a lot. They will be more useful for people who already know a bit of code, and Firebot has many alternatives to almost anything you can do in a sandboxed JS script if you are not comefortable with coding. \ No newline at end of file diff --git a/src/navigation.ts b/src/navigation.ts index 0a9ad55..a3a4392 100644 --- a/src/navigation.ts +++ b/src/navigation.ts @@ -31,6 +31,7 @@ export const nav: Array = [ { title: 'Conditional Effects', href: '/v5/guides/conditional-effects' }, { title: 'Time Variables', href: '/v5/guides/time-variable' }, { title: 'Custom Variables', href: '/v5/guides/custom-variables' }, + { title: 'Evaluate JavaScript', href: '/v5/guides/evaluate-javascript' }, { title: 'Manual Restore', href: '/v5/guides/manual-restore' }, ], }, From 56c7d8f2c30352649bf086c99c0c93d3c25dafef Mon Sep 17 00:00:00 2001 From: Oshimia <120189186+Oshimia@users.noreply.github.com> Date: Sat, 1 Mar 2025 02:18:07 +0700 Subject: [PATCH 2/4] Correcting syntax for object walkpath in guide --- src/app/v5/guides/custom-variables/page.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/v5/guides/custom-variables/page.mdx b/src/app/v5/guides/custom-variables/page.mdx index 292d386..da79099 100644 --- a/src/app/v5/guides/custom-variables/page.mdx +++ b/src/app/v5/guides/custom-variables/page.mdx @@ -21,11 +21,11 @@ This is used for accessing or modifying specific parts of complex data structure Access "banana" with `$$myArray[1]`. - **Object Example:** `{"fruit":"apple", "color":"red"}` - Access "apple" with `$$myObject.fruit`. + Access "apple" with `$$myObject[fruit]`. - **Array of Objects Example:** `[{"fruit":"apple"}, {"fruit":"banana"}]` - Access "apple" with `$$myArray[0].fruit`. + Access "apple" with `$$myArray[0, fruit]`. You can use the Property Path field to update a specific part of the variable without overwriting the entire structure. From 2a6a7dc4dfcc34af50ecd3e8ae653f6683802bcb Mon Sep 17 00:00:00 2001 From: Oshimia <120189186+Oshimia@users.noreply.github.com> Date: Wed, 16 Apr 2025 03:27:31 +0700 Subject: [PATCH 3/4] Adding Commands documentation to Core Concepts --- src/app/v5/core/commands/page.mdx | 141 ++++++++++++++++++++++++++++++ 1 file changed, 141 insertions(+) create mode 100644 src/app/v5/core/commands/page.mdx diff --git a/src/app/v5/core/commands/page.mdx b/src/app/v5/core/commands/page.mdx new file mode 100644 index 0000000..8161404 --- /dev/null +++ b/src/app/v5/core/commands/page.mdx @@ -0,0 +1,141 @@ +# Commands + +Commands, or chat commands, are a way for your viewers to interact with Firebot. Commands can be triggered by typing a specific keyword or phrase in chat, and can be used to run effects, send messages, or perform other actions. + +They can be found in the **Commands** tab of Firebot on the left of the UI under "Triggers". + +Commands are a great way to engage with your viewers and add interactivity to your stream. You can create commands for fun effects, games, or even to provide information about your stream or channel. + +# Custom Commands + +Custom commands are commands that you create yourself. They can be triggered by a specific keyword or phrase, and can be used to run effects, send messages, or perform other actions. + +You can make a new custom command by clicking the blue **"New Custom Command"** button in the top left of the commands tab. This will open a new window where you can enter the command trigger and effects. + +There are two ways to view the Add New Command UI: **Simple Mode** and **Advanced Mode**. You can switch between these at any time by using the blue "Switch to Advanced/Simple Mode ->" link at the bottom of the UI, but be aware that only Advanced mode has an effects list and switching to simple mode will remove effects in that effects list. + +## Simple Mode + +Simple Mode is the default view, with the following settings: + +* **Trigger**: + * A trigger is the keyword or phrase that will activate the command. For example, if you create a command with the trigger `!hello`, viewers can type `!hello` in chat to activate the command. + * Triggers can be any combination of letters, numbers, and symbols, but they must be unique to each command. + * You can also use phrases as triggers, such as `"hello world"`, but these are not recommended as they can be easily confused with other messages in chat. + * It is common to use an exclamation mark `!` at the start of a trigger to indicate that it is a command. You can also use other symbols, such as `?`, but these are less common. + +* **Cooldowns**: + * Cooldowns are a way to timeout a command. You have two options: + * **Global Cooldown**: A timer that applies to all users, meaning that once the command is used, no one can use it again until the cooldown expires. + * **User Cooldown**: A timer that applies to each individual user, meaning that once a user uses the command, they cannot use it again until the cooldown expires. + * Cooldowns are useful for preventing spam and ensuring that commands are used at a reasonable rate. You can set the cooldown in seconds. + +* **Permissions**: + * Permissions are a way to limit who can use the command. You can set permissions so that: + * Everyone can trigger a command. + * Subs Only can trigger a command. + * Mods Only can trigger a command. + +* **Response Text**: + * Response text is the message that will be sent in chat when the command is triggered. This can be a simple message, such as "Hello World". + * If you want to use more complex effects, you will want to switch to advanced mode. + +## Advanced Mode + +Advanced Mode is a more complex view with additional settings. You can switch to Advanced Mode by clicking the blue "Switch to Advanced Mode ->" link at the bottom of the UI. + +Below is a description of each setting in Advanced Mode: + +* **Trigger**: + * This acts exactly like the trigger setting from the Simple Mode UI, but also allows for two more optional settings: + * **Auto Delete Trigger**: Automatically deletes the trigger message from chat after the command is run. This is useful for commands that are meant to be used once, such as a trivia game or a giveaway. + * **Scan Whole Message**: Scans the entire message for the trigger. This is useful for commands that are meant to be used in a sentence, such as "I love Firebot". If this option is not selected, only the first word of the message will be scanned for the trigger. + +* **Description**: + * A short text that explains what the command does. + * Descriptions are optional, but recommended for clarity. + * These cannot be seen directly in the stream, but viewers will be able to find them when they use `!commands` in chat, which provides a link displaying all available and non-hidden commands. + +* **Aliases**: + * Alternative triggers that can be used to activate the command. For example, if you create a command with the trigger `!hello`, you can add an alias `!hi`. + * Aliases are optional but useful for providing multiple ways to access the same command. + * You can add as many aliases as you like, but keep them short and relevant. + +* **Cooldowns**: + * This acts exactly like the cooldown setting from the Simple Mode UI, but will also allow for two more options (details not specified in the original text). + +* **Stats**: + * Tracks how many times a specific command has been used in your chat, useful for seeing command popularity. + +* **Restrictions**: + * Limit who can use the command based on roles (e.g., all users, subscribers, moderators, streamers, custom roles). + * Useful for commands meant for specific user groups. + * Roles can be managed in the "ROLES & RANKS" tab. + * To set a restriction, click the "+" and select the restriction type. Multiple restrictions can be set. + +* **Settings**: + * **Enabled**: Determines if the command is active. If "off", the command won't trigger in chat. Useful for temporarily disabling commands. + * **Hidden**: Hides the command from the list generated by `!commands`. Useful for moderator commands or commands under testing. + * **Treat quoted text as single argument**: When enabled, text inside quotes (e.g., `"Hello World"`) is treated as one argument (e.g., in `!command add !hello "Hello World"`). If disabled, quoted text is split into multiple arguments. + +* **Ignore**: + * Allows the command to ignore triggers from specific accounts or sources: + * **Streamer Account** + * **Bot Account** + * **Whispers** + * Useful if you want users to trigger a command (e.g., `!hello`) but not the bot or streamer account itself. + +* **Shared Chat**: + * Configure how commands react to shared chat messages: + * **Allow**: Reacts to shared chat messages as if they came from your own chat. + * **Ignore**: Ignores shared chat messages. + * **Inherit**: Uses the global setting from `Settings > Triggers > Allow Shared Chat`. + +## Base Effects + +This is where you add actions to your command. You can find out more about effects here: [Firebot Effects](https://docs.firebot.app/v5/core/effects). + +* Add effects by clicking the blue **"Add Effect"** button in the bottom right of the UI. +* Select the desired effect from the new window. +* Multiple effects can be added and will run in the order they appear. +* Remove effects by clicking the three dots on the effect bar and selecting "Delete". + +## Subcommands + +Subcommands allow you to trigger different effects based on arguments (words/numbers) provided after the main command trigger. + +* They trigger different effects *instead* of the main command's effects list. +* Click the **"+"** symbol to add an argument for a new subcommand. +* Clicking the subcommand opens a UI identical to the main command UI for configuring its specific effects and settings. +* You can add multiple subcommands, but you cannot add a subcommand to another subcommand. +* For more complex conditional logic, consider using [conditional effects](https://docs.firebot.app/v5/guides/conditional-effects). + +# System Commands + +System commands are built-in commands available in all Firebot installations. You can find them by swapping to the **"SYSTEM COMMANDS"** tab (top left, above the "New Custom Command" button). + +These include basic commands like `!commands` (provides a link to the commands page) and `!uptime` (shows stream duration), as well as commands specific to Firebot currencies that are automatically created when you add a new currency in the "Currencies" tab. + +Below is an example of commands automatically created for a "gold" currency: + +| Name | !Trigger | Description | Usage | +|-------------------|----------|-----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **gold Management** | !gold | Allows management of the "gold" currency. | `!gold` — See your balance.
`!gold @username` — Gets the currency of the specified user.
`!gold add [@user] [amount]` — Adds currency for a given user.
`!gold remove [@user] [amount]` — Removes currency for a given user.
`!gold give [@user] [amount]` — Gives currency from one user to another user.
`!gold set [@user] [amount]` — Sets currency to the amount.
`!gold addall [amount]` — Adds currency to all online users.
`!gold removeall [amount]` — Removes currency from all online users. | + +Below is a list of all standard system commands available in Firebot. These can be enabled or disabled in the commands tab. + +| Name | !Trigger | Description | Usage | +|-------------------------|--------------------|--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **Bid** | !bid | Allows viewers to participate in the Bid game. | `!bid start [currencyAmount]` — Starts the bidding at the given amount.
`!bid stop` — Manually stops the bidding. Highest bidder wins.
`!bid [currencyAmount]` — Joins the bidding at the given amount. | +| **Command List** | !commands | Displays a link to your profile page with all available commands. | `!commands` | +| **Command Management** | !command | Allows custom command management via chat. | `!command add [!trigger or "phrase"] [message]` — Adds a new command with a given response message.
`!command response [!trigger or "phrase"] [message]` — Updates the response message for a command. Only works for commands that have 1 or less chat effects.
`!command setcount [!trigger or "phrase"] count#` — Updates the commands usage count.
`!command cooldown [!trigger or "phrase"] [globalCooldownSecs] [userCooldownSecs]` — Change the cooldown for a command.
`!command restrict [!trigger or "phrase"] [All/Sub/Mod/Streamer/Custom Group]` — Update permissions for a command.
`!command remove [!trigger or "phrase"]` — Removes the given command.
`!command description [!trigger or "phrase"]` — Updates the description for a command.
`!command enable [!trigger or "phrase"]` — Enables the given custom command.
`!command disable [!trigger or "phrase"]` — Disables the given custom command.
`!command addalias [!trigger or "phrase"] !alias` — Adds the specified alias to the given custom command.
`!command removealias [!trigger or "phrase"] !alias` — Removed the specified alias from the given custom command. | +| **Create Stream Marker** | !marker | Create a stream marker. | `!marker [marker name]` | +| **Custom Role Management** | !role | Allows management of viewer's custom roles from chat. | `!role add @viewer roleName` — Adds a custom role to a viewer.
`!role remove @viewer roleName` — Removes a custom role from a viewer.
`!role list [@viewer]` — List all custom roles, or just roles a viewer has. | +| **Follow Age** | !followage | Displays how long the user has been following the channel. | `!followage` | +| **Heist** | !heist | Allows viewers to play the Heist game. | `!heist` — Starts/joins the heist with the default wager amount, if one is set.
`!heist [wagerAmount]` — Starts/joins the heist with the given amount. | +| **Quotes Management** | !quote | Allows quote management via chat. | `!quote` — Display a random quote
`!quote [quoteId]` — Displays the quote with the given ID.
`!quote add [@username] [quoteText]` — Adds a new quote.
`!quote remove [quoteId]` — Removes a quote using its id.
`!quote edittext [quoteId] [newText]` — Edit the text given quote.
`!quote edituser [quoteId] [newUsername]` — Edit the user of the given quote.
`!quote editgame [quoteId] [newGame]` — Edit the game of the given quote.
`!quote editdate [quoteId] [newDate]` — Edit the date of the given quote.
`!quote list` — Gives a link that lists out all quotes.
`!quote search [searchTerm]` — Gives a random quote using the search term(s).
`!quote searchuser @username` — Gives a random quote said by the given user.
`!quote searchdate DD MM YYYY` — Gives a random quote at the given date.
`!quote searchgame [searchTerm]` — Gives a random quote at the given game. | +| **Spam Raid Protection** | !spamraidprotection| Toggles protective measures such as follow-only mode, slow mode, etc.| `!spamraidprotection off` — Turn off the protection command. | +| **Spin (Slots)** | !spin | Allows viewers to play the Slots game. | `!spin [currencyAmount]` — Spins the slot machine with the given amount | +| **Steam Search** | !steam | Displays information about a game on Steam. | `!steam [game name]` | +| **Trivia** | !trivia | Allows viewers to play trivia | `!trivia [wager]` — Triggers trivia for the given wager amount | +| **Uptime** | !uptime | Displays how long the stream has been live in chat. | `!uptime` | From d911c75c028bbaf622ac678a50954631acb0b5ea Mon Sep 17 00:00:00 2001 From: Oshimia <120189186+Oshimia@users.noreply.github.com> Date: Wed, 16 Apr 2025 03:27:31 +0700 Subject: [PATCH 4/4] Adding Commands documentation to Core Concepts --- src/app/v5/core/commands/page.mdx | 141 ++++++++++++++++++++++++++++++ src/navigation.ts | 2 +- 2 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 src/app/v5/core/commands/page.mdx diff --git a/src/app/v5/core/commands/page.mdx b/src/app/v5/core/commands/page.mdx new file mode 100644 index 0000000..8161404 --- /dev/null +++ b/src/app/v5/core/commands/page.mdx @@ -0,0 +1,141 @@ +# Commands + +Commands, or chat commands, are a way for your viewers to interact with Firebot. Commands can be triggered by typing a specific keyword or phrase in chat, and can be used to run effects, send messages, or perform other actions. + +They can be found in the **Commands** tab of Firebot on the left of the UI under "Triggers". + +Commands are a great way to engage with your viewers and add interactivity to your stream. You can create commands for fun effects, games, or even to provide information about your stream or channel. + +# Custom Commands + +Custom commands are commands that you create yourself. They can be triggered by a specific keyword or phrase, and can be used to run effects, send messages, or perform other actions. + +You can make a new custom command by clicking the blue **"New Custom Command"** button in the top left of the commands tab. This will open a new window where you can enter the command trigger and effects. + +There are two ways to view the Add New Command UI: **Simple Mode** and **Advanced Mode**. You can switch between these at any time by using the blue "Switch to Advanced/Simple Mode ->" link at the bottom of the UI, but be aware that only Advanced mode has an effects list and switching to simple mode will remove effects in that effects list. + +## Simple Mode + +Simple Mode is the default view, with the following settings: + +* **Trigger**: + * A trigger is the keyword or phrase that will activate the command. For example, if you create a command with the trigger `!hello`, viewers can type `!hello` in chat to activate the command. + * Triggers can be any combination of letters, numbers, and symbols, but they must be unique to each command. + * You can also use phrases as triggers, such as `"hello world"`, but these are not recommended as they can be easily confused with other messages in chat. + * It is common to use an exclamation mark `!` at the start of a trigger to indicate that it is a command. You can also use other symbols, such as `?`, but these are less common. + +* **Cooldowns**: + * Cooldowns are a way to timeout a command. You have two options: + * **Global Cooldown**: A timer that applies to all users, meaning that once the command is used, no one can use it again until the cooldown expires. + * **User Cooldown**: A timer that applies to each individual user, meaning that once a user uses the command, they cannot use it again until the cooldown expires. + * Cooldowns are useful for preventing spam and ensuring that commands are used at a reasonable rate. You can set the cooldown in seconds. + +* **Permissions**: + * Permissions are a way to limit who can use the command. You can set permissions so that: + * Everyone can trigger a command. + * Subs Only can trigger a command. + * Mods Only can trigger a command. + +* **Response Text**: + * Response text is the message that will be sent in chat when the command is triggered. This can be a simple message, such as "Hello World". + * If you want to use more complex effects, you will want to switch to advanced mode. + +## Advanced Mode + +Advanced Mode is a more complex view with additional settings. You can switch to Advanced Mode by clicking the blue "Switch to Advanced Mode ->" link at the bottom of the UI. + +Below is a description of each setting in Advanced Mode: + +* **Trigger**: + * This acts exactly like the trigger setting from the Simple Mode UI, but also allows for two more optional settings: + * **Auto Delete Trigger**: Automatically deletes the trigger message from chat after the command is run. This is useful for commands that are meant to be used once, such as a trivia game or a giveaway. + * **Scan Whole Message**: Scans the entire message for the trigger. This is useful for commands that are meant to be used in a sentence, such as "I love Firebot". If this option is not selected, only the first word of the message will be scanned for the trigger. + +* **Description**: + * A short text that explains what the command does. + * Descriptions are optional, but recommended for clarity. + * These cannot be seen directly in the stream, but viewers will be able to find them when they use `!commands` in chat, which provides a link displaying all available and non-hidden commands. + +* **Aliases**: + * Alternative triggers that can be used to activate the command. For example, if you create a command with the trigger `!hello`, you can add an alias `!hi`. + * Aliases are optional but useful for providing multiple ways to access the same command. + * You can add as many aliases as you like, but keep them short and relevant. + +* **Cooldowns**: + * This acts exactly like the cooldown setting from the Simple Mode UI, but will also allow for two more options (details not specified in the original text). + +* **Stats**: + * Tracks how many times a specific command has been used in your chat, useful for seeing command popularity. + +* **Restrictions**: + * Limit who can use the command based on roles (e.g., all users, subscribers, moderators, streamers, custom roles). + * Useful for commands meant for specific user groups. + * Roles can be managed in the "ROLES & RANKS" tab. + * To set a restriction, click the "+" and select the restriction type. Multiple restrictions can be set. + +* **Settings**: + * **Enabled**: Determines if the command is active. If "off", the command won't trigger in chat. Useful for temporarily disabling commands. + * **Hidden**: Hides the command from the list generated by `!commands`. Useful for moderator commands or commands under testing. + * **Treat quoted text as single argument**: When enabled, text inside quotes (e.g., `"Hello World"`) is treated as one argument (e.g., in `!command add !hello "Hello World"`). If disabled, quoted text is split into multiple arguments. + +* **Ignore**: + * Allows the command to ignore triggers from specific accounts or sources: + * **Streamer Account** + * **Bot Account** + * **Whispers** + * Useful if you want users to trigger a command (e.g., `!hello`) but not the bot or streamer account itself. + +* **Shared Chat**: + * Configure how commands react to shared chat messages: + * **Allow**: Reacts to shared chat messages as if they came from your own chat. + * **Ignore**: Ignores shared chat messages. + * **Inherit**: Uses the global setting from `Settings > Triggers > Allow Shared Chat`. + +## Base Effects + +This is where you add actions to your command. You can find out more about effects here: [Firebot Effects](https://docs.firebot.app/v5/core/effects). + +* Add effects by clicking the blue **"Add Effect"** button in the bottom right of the UI. +* Select the desired effect from the new window. +* Multiple effects can be added and will run in the order they appear. +* Remove effects by clicking the three dots on the effect bar and selecting "Delete". + +## Subcommands + +Subcommands allow you to trigger different effects based on arguments (words/numbers) provided after the main command trigger. + +* They trigger different effects *instead* of the main command's effects list. +* Click the **"+"** symbol to add an argument for a new subcommand. +* Clicking the subcommand opens a UI identical to the main command UI for configuring its specific effects and settings. +* You can add multiple subcommands, but you cannot add a subcommand to another subcommand. +* For more complex conditional logic, consider using [conditional effects](https://docs.firebot.app/v5/guides/conditional-effects). + +# System Commands + +System commands are built-in commands available in all Firebot installations. You can find them by swapping to the **"SYSTEM COMMANDS"** tab (top left, above the "New Custom Command" button). + +These include basic commands like `!commands` (provides a link to the commands page) and `!uptime` (shows stream duration), as well as commands specific to Firebot currencies that are automatically created when you add a new currency in the "Currencies" tab. + +Below is an example of commands automatically created for a "gold" currency: + +| Name | !Trigger | Description | Usage | +|-------------------|----------|-----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **gold Management** | !gold | Allows management of the "gold" currency. | `!gold` — See your balance.
`!gold @username` — Gets the currency of the specified user.
`!gold add [@user] [amount]` — Adds currency for a given user.
`!gold remove [@user] [amount]` — Removes currency for a given user.
`!gold give [@user] [amount]` — Gives currency from one user to another user.
`!gold set [@user] [amount]` — Sets currency to the amount.
`!gold addall [amount]` — Adds currency to all online users.
`!gold removeall [amount]` — Removes currency from all online users. | + +Below is a list of all standard system commands available in Firebot. These can be enabled or disabled in the commands tab. + +| Name | !Trigger | Description | Usage | +|-------------------------|--------------------|--------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **Bid** | !bid | Allows viewers to participate in the Bid game. | `!bid start [currencyAmount]` — Starts the bidding at the given amount.
`!bid stop` — Manually stops the bidding. Highest bidder wins.
`!bid [currencyAmount]` — Joins the bidding at the given amount. | +| **Command List** | !commands | Displays a link to your profile page with all available commands. | `!commands` | +| **Command Management** | !command | Allows custom command management via chat. | `!command add [!trigger or "phrase"] [message]` — Adds a new command with a given response message.
`!command response [!trigger or "phrase"] [message]` — Updates the response message for a command. Only works for commands that have 1 or less chat effects.
`!command setcount [!trigger or "phrase"] count#` — Updates the commands usage count.
`!command cooldown [!trigger or "phrase"] [globalCooldownSecs] [userCooldownSecs]` — Change the cooldown for a command.
`!command restrict [!trigger or "phrase"] [All/Sub/Mod/Streamer/Custom Group]` — Update permissions for a command.
`!command remove [!trigger or "phrase"]` — Removes the given command.
`!command description [!trigger or "phrase"]` — Updates the description for a command.
`!command enable [!trigger or "phrase"]` — Enables the given custom command.
`!command disable [!trigger or "phrase"]` — Disables the given custom command.
`!command addalias [!trigger or "phrase"] !alias` — Adds the specified alias to the given custom command.
`!command removealias [!trigger or "phrase"] !alias` — Removed the specified alias from the given custom command. | +| **Create Stream Marker** | !marker | Create a stream marker. | `!marker [marker name]` | +| **Custom Role Management** | !role | Allows management of viewer's custom roles from chat. | `!role add @viewer roleName` — Adds a custom role to a viewer.
`!role remove @viewer roleName` — Removes a custom role from a viewer.
`!role list [@viewer]` — List all custom roles, or just roles a viewer has. | +| **Follow Age** | !followage | Displays how long the user has been following the channel. | `!followage` | +| **Heist** | !heist | Allows viewers to play the Heist game. | `!heist` — Starts/joins the heist with the default wager amount, if one is set.
`!heist [wagerAmount]` — Starts/joins the heist with the given amount. | +| **Quotes Management** | !quote | Allows quote management via chat. | `!quote` — Display a random quote
`!quote [quoteId]` — Displays the quote with the given ID.
`!quote add [@username] [quoteText]` — Adds a new quote.
`!quote remove [quoteId]` — Removes a quote using its id.
`!quote edittext [quoteId] [newText]` — Edit the text given quote.
`!quote edituser [quoteId] [newUsername]` — Edit the user of the given quote.
`!quote editgame [quoteId] [newGame]` — Edit the game of the given quote.
`!quote editdate [quoteId] [newDate]` — Edit the date of the given quote.
`!quote list` — Gives a link that lists out all quotes.
`!quote search [searchTerm]` — Gives a random quote using the search term(s).
`!quote searchuser @username` — Gives a random quote said by the given user.
`!quote searchdate DD MM YYYY` — Gives a random quote at the given date.
`!quote searchgame [searchTerm]` — Gives a random quote at the given game. | +| **Spam Raid Protection** | !spamraidprotection| Toggles protective measures such as follow-only mode, slow mode, etc.| `!spamraidprotection off` — Turn off the protection command. | +| **Spin (Slots)** | !spin | Allows viewers to play the Slots game. | `!spin [currencyAmount]` — Spins the slot machine with the given amount | +| **Steam Search** | !steam | Displays information about a game on Steam. | `!steam [game name]` | +| **Trivia** | !trivia | Allows viewers to play trivia | `!trivia [wager]` — Triggers trivia for the given wager amount | +| **Uptime** | !uptime | Displays how long the stream has been live in chat. | `!uptime` | diff --git a/src/navigation.ts b/src/navigation.ts index a3a4392..bf614ee 100644 --- a/src/navigation.ts +++ b/src/navigation.ts @@ -12,7 +12,7 @@ export const nav: Array = [ title: 'Core concepts', links: [ { title: 'Effects', href: '/v5/core/effects' }, - { title: 'Commands', href: '/commands' }, + { title: 'Commands', href: '/v5/core/commands' }, { title: 'Events', href: '/events' }, { title: 'Timers', href: '/timers' }, { title: 'Channel Rewards', href: '/channel-rewards' },