Skip to content

Creating a command

Duncan Sterken edited this page Mar 8, 2024 · 1 revision

Hi there! On this page you will learn how to create a custom command file.

All command files are written in a structured YAML file, you can learn about yaml on this page: http://thomasloven.com/blog/2018/08/YAML-For-Nonprogrammers/

Now that you know how YAML works, it's time to write a simple hello world command!

name: hello-world
description: A simple hello world command

output: |-
    "Hello world!"

Boom! It is that easy! Now we can save this file as hello-world.yaml (you can see that I used the command name for the file name) and test it on the bot!

Showing the command

And it returns exactly what we typed in the quotes!

Running the command

Now, let me explain what we typed exactly. First we typed name: hello-world, IO sees this as the name of the command. Please keep in mind that command names cannot have spaces and are limited to 25 characters.

After that we typed the description of the command, this is just a piece of simple text.

Finally we have this weird line output: |-. This line means that the next line is just text. We have to type it this way or YAML does not see the quotes we type. You need the quotes around the text on the next line due to the advanced things the system can do.

Clone this wiki locally