What You'll Learn 🧠
- What Command blocks do
- How to use Command blocks
- How Command blocks work
What Command Blocks Do
Command blocks hold a flow that will play, then return the user to where they were when the Command block was activated.
For example, if the user activates a Command Flow for 'Help', you may create a flow that helps the user, and when the flow is done they are returned to where they were in the Skill before they activated the flow.
Because of this, Command flows do not have any ports. They are constantly listening for the user to say their key word or key phrase, and when activated they will automatically start. When the flow within the Command is done, the user will return to where they were in the skill.
How to use Command blocks (Command flows)
- Enter the Command block
To use a Command flow, first click on the + at the bottom of the Home block. When you do, click on the block to open up its menu.
2. Select an Intent to activate the Command block
Within the menu, you'll see it's very similar to an Intent block. You can create intents & slots. To select an intent that activates the command block, select an intent using the 'Select intent' drop-down.
3. Create or Select the Command Flow
Every Command block is linked to a Command flow. We need to either make a new Command flow, or select an existing flow to use as our Command flow.
Creating a new flow
When creating a new Command flow, you will be brought to a new canvas. Here, you can build out the flow your Command block will follow. When your Command flow ends (last block without a connector), your Command flow will end and return the user to where they were before they said the Command.
Selecting an existing flow
You may also reuse an existing flow when creating a Command flow. To do this, select the 'Select Existing Flow' dropdown and choose the flow you would like to use.
Changing the Command flow
If you would like to change the flow your Command block is using, you can hit the 'Unlink flow' button to unlink the flow you created, from the Command block using it.
4. How can a Command block ends the skill?
If your Command block is meant to end the skill after it is activated, use the Exit block in your flow where you want to exit the skill.
When this is used, after the Command flow is completed, rather than returning the user to where they last were in the skill, the Skill will end.
Still have questions? Be sure to post in our Forums to get fast answers!