Using MiScript to create custom commands
1 minute read
1 minute read
Mi(ki)Script is Miki's custom command language, specifically written to make it easy to use custom commands. In this guide we will show you how to get started with MiScript.
|>createcommand [command name] [script]||Used to create a custom command|
|>removecommand [command name]||Used to delete an existing custom command|
say "hello world"
As you might realize, this command simply makes Miki say "hello world". There's nothing else happening.
sometimes you may want to include some additional information in your discord chats. The ability to add text from variables provided by Miki makes this possible.
say "Hello $[author]"
This would for example return
Different responses are also allowed, for example you can add conditional branches as shown below.
if $author = "Veld" then say "Hello Veld!" else say "Wait, you're not Veld!" end
Since there is a message limit on Discord, using
else over and over again is not a good idea for bigger commands. using
stop will stop the script and return the current output.
say "This message will be shown!" stop say "However, this message will be ignored!"
So now that you know how to create a script, Lets take a look at how to add it in your server!
Note: this will only work if you have the
MANAGE ROLESpermission in the Discord server.
>createcommand "testcommand" say "$[author]! Long time no see!"
And if everything goes well, you will see this:
To remove a command you have created, you can use
>removecommand [command name]. For example, if you wanted to remove the command we created above you would use
>removecommand testcommand. If done correctly, you should see the following: