Examples

Quotes Commands for v1.0.0+

An example how to get and add quotes using commands in Streamer.bot v1.0.0+
This is only for Streamer.bot v1.0.0 and above!

In Streamer.bot v1.0.0+, the built-in quote command "!quote" has been removed. This allows for more customization and flexibility in how quotes are retrieved and displayed. With that the "Show Quote" trigger will also not work anymore. The following example shows how to create your own "!quote" command to either retrieve a random quote or a specific quote by its index.

An import is provided at the end of the instructions, which includes a "!quote" and "!quoteadd" command.

The instructions below will guide you through the process of creating a quote command that can retrieve quotes, and add new quotes. Keep in mind this is just an example, and you can customize the sub-actions to your liking. The following sub-actions will be used to retrieve a random quote or a specific quote by its index. It will also be checked whether or not a command input is a number or not via inline math.

Instructions (Get Quote)

1

Creating an action

To create a new action head to the Actions tab and right-click in the actions section. Select Add Action and name it something like "Get Quote". This action will be used to retrieve a random quote or a specific quote by its index.
2

Adding the "!quote" command trigger

Next step would be adding our trigger for the command. Right-click in the Triggers section and select Core -> Commands -> Command Triggered. If you already have a command like "!quote" and want to use that, you can select it from the dropdown menu. If not, you can create a new command by clicking on the Create Command button below the dropdown.Give the command a name like "Get Quote" and set the command itself to !quote, or anything you like. Leave the location to Start, this will allow the command to also check an input.The other settings can be left as is, unless you want to change them. For example, you can set the Cooldown to prevent spamming the command.Add Quote Command
3

Check whether input is empty or not First we want to check whether the input, in our case the argument

input0 is empty or not. If it is empty, we will retrieve a random quote, otherwise we will try to retrieve a specific quote by the input. To do this, we will use an the sub-action Core -> Logic > If/Else.
  • In the Input field you would write %input0% to get the value of the input0 argument.
  • The Operation would be Is Null or Empty.
After clicking OK, you will see a new If/Else block in your action. In the True group, we will retrieve a random quote, and in the False group we will try to retrieve a specific quote by its index. Check if empty
4

Get a random quote and send the message

In the True group of the If/Else block, we will retrieve a random quote. To do this, right-click on the True Result group and add the sub-action Core -> Quotes -> Get Quote. Or you can also click on the True Result group and search for the Get Quote sub-action in the search bar.In the sub-action itself make sure you select Random as the Type and click OK. This will retrieve a random quote from the quotes.Next, we want to send the quote as a message. Add the sub-action Twitch -> Chat -> Send Message to Channel to the True Result group, and make sure it's under the Get Random Quote sub-action. In the Message field you can write something like %quoteId% %quote% - %quoteUser% to send the quote ID, the quote itself and the user who added the quote.
5

Check whether input is a number or not

In the False group of the If/Else block, we will continue down the path to retrieve a specific quote by its index.However first we want to check whether the input is a number or not, this would still be in the False group.This can be done the following way:
  1. Add a sub-action Core -> Arguments -> Set Argument.
    • Variable Name: quoteNum
    • Value: $math( floor( %input0% ) )$

    The math function will round down the input to the nearest whole number. If the value of input0 is not a number, the value of quoteNum will be NaN which we can check with another if/else.
    Read more in Guide > Variables > Math
  2. Add another If/Else sub-action to check whether the quoteNum value is a number or not.
    • Input: %quoteNum%
    • Operation: Equals
    • Value: NaN
In the True group, you can now add another sub-action to send a message to the channel that the input is not a number, or you simply leave it empty.In the False group, we will continue and try to retrieve the specific quote by its index.Counter Message
6

Get a specific quote and send the message

Since we have already checked that the input is a number, we can now retrieve the specific quote by its index. To do this we want to add the sub-action Core -> Quotes -> Get Quote, and as the Type we will select Specific. The Quote ID field will be set to %quoteNum%, which will retrieve the value of the quoteNum variable we set earlier.
Read more in API > Sub Actions > Core > Quotes > Get Quote
The last thing we want to do is check whether or not a quote was able to be retrieved. This can be done by adding yet another If/Else sub-action under the Get Quote sub-action.We want to check whether the argument quote, or other quote related arguments were even created by the Get Quote sub-action.
  • Input: quote
  • Operation: Does Not Exist
Why do we not add % around quote? Because we don't want the value of the quote argument, but rather check if the literal name quote exists as an argument.
  • In the True group, we can add a sub-action to send a message to the channel that the quote was not found, or you can leave it empty.
  • In the False group, we can add the sub-action Twitch -> Chat -> Send Message to Channel to send the quote as a message.
    • For example: #%quoteId%: %quote% - %quoteUser%
Counter Message

Instructions (Add Quote)

Adding a quote is fairly straightforward, we will create a new action that will be used to add a simple command input as the quote. The quote will be referenced to the streamer, and not the the user who added it via the command. Referencing a quote to a different user when you add it requires you to use the C# methods for adding quotes.

Read more in API > C# > Core > Quotes
1

Creating an action

To create a new action head to the Actions tab and right-click in the actions section. Select Add Action and name it something like "Add Quote".
2

Adding the "!quoteadd" command trigger

This step is pretty much the same as the previous one for just adding a !quote command. Just in this case we give it a different name and a different command itself.
  • Right-click in the Triggers section and select Core -> Commands -> Command Triggered. If you already have a command like "!quoteadd" and want to use that, you can select it from the dropdown menu. If not, you can create a new command by clicking on the Create Command button below the dropdown.
Give the command a name like "Add Quote" and set the command itself to !quoteadd, or anything you like. Leave the location to Start, this will allow the command to also check an input.The other settings can be left as is, unless you want to change them. For example, you can set the Cooldown to prevent spamming the command.
3

Adding the quote itself

Next, we want to add the quote itself. To do this, we will use the sub-action Core -> Quotes -> Add Quote.In the Variable field, we will write %rawInput%, this will get the whole input of the command, so the value of rawInput.Add Quote Sub-Action
4

Check if the quote was added successfully

After adding the quote, we want to check whether or not the quote was added successfully. This can be done by adding another If/Else sub-action.
  • Input: %success%
  • Operation: Equals
  • Value: True
In the False group, we can then add a Break sub-action to stop the action from continuing, since the quote was not added successfully.Below the whole If/Else block, you can also put this in the True group`, we can then add a sub-action to send a message to the channel that the quote was added successfully.So create a sub-action Twitch -> Chat -> Send Message to Channel and write something like Quote added successfully! ID: %quoteId% - %quote% in the Message field.

Import

As mentioned at the start here is the import for Streamer.bot v1.0.0 and above. This includes the !quote and !quoteadd commands, and the needed actions.

Import Code
U0JBRR+LCAAAAAAABADtW0mP20YWvgfIf2A6MZBgXE7ti2+OZ+Lpi5EZe3IxfKi1TUQSFZLqthH4v09xldQkJard3W4bqYMgsl5tb/1eVfGvb79JkrOlL/XZ0+Sv6iE+rvTSx8ezN//ZZKUv3iYvfPnzM+cSndRvzh63hHpTvsvyivRVmfvYKn9isjIByfpq9eFDT3bp8yLNVhUdegKfwL7C+cLm6bpsK+MwSa5XLlsmWZ4Ua2/TkNrkz2rMJL5PdD2H5jlEkr1R667/sTu37L+b1TPb9r7aLBZd3TJdpcvN8vd+XlVlVfexpjhzeo8fuu6jiG/eNG+SrqquTl29MgtZwD4AxZ0DFEIPJDcMUKoCQY4iL203ubrZ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