Creating your first command
Since you created a new project, let's create your very own command!
Say command
What we'll be creating:
We will create a simple command named 'say' that has a parameter named text.
Then, the bot would simply send back whatever text was passed to it.
Example
User: !say Hello World!
Bot: Hello World!
Procedure
Okay let's start. Firstly, when you create the project you will be presented with a sample hello command. It simply just says Hello, World. Let's delete this and start from scratch.
Click on the two nodes and delete it.
Tip
Deleting a node is as simple as clicking it then hitting the backspace key.
How to select multiple nodes at once?
You can press and hold the shift key then drag your mouse by clicking it over the nodes you want to delete. This makes a group selection. Now press the backspace key and watch them dissapear
Now let's do these steps.
- Drag and drop a "Command" from Special Components
- Change the name to
say - Add a description (optional)
- Add a parameter with the +
- Name the parameter to
text(this can be whatever you want) - Change the parameter type to Text
You created the command!
- Now drag and drop a "Say" node from Action Components
- Connect the command to the say action
- Write
{text}in the say action
You have now created the say action.
The command we want is now ready, therefore hit reload bot and execute the command.
Here's a video demonstration of what we just did:
