From b788b350bea4a3350c23dd2ff8861050a4a24dca Mon Sep 17 00:00:00 2001 From: Yessiest <70776062+yessiest@users.noreply.github.com> Date: Mon, 21 Feb 2022 17:37:26 +0000 Subject: [PATCH] Added aliases page --- Aliases.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Aliases.md diff --git a/Aliases.md b/Aliases.md new file mode 100644 index 0000000..aa3b46e --- /dev/null +++ b/Aliases.md @@ -0,0 +1,39 @@ +# Aliases +Aliases are the easiest way to get some things done in this bot. +Aliases are essentially a way to bind a command to some specific keyword that you can activate later. +To use them, load the ``meta`` plugin. + +## Syntax +An alias consists of 2 pieces: the trigger and the command. +To create an alias, use the ``alias`` command as follows: +``` +alias "name" "command to execute" +``` +After you have created an alias, you can simply activate it by typing it's name. + +Example (assuming ``toolbox`` plugin is loaded and your prefix is ``/``): +``` +/alias "/rules" "/echo ``` +Rules of this server: +1) Respect each other. +2) Do not post harmful or violent content. +3) Be cool. +```" +``` +## Arguments +Sometimes you might want to pass additional arguments to the command inside an alias. +There are multiple way to do so: +1. Specify a single argument using a dollar sign (``$``) and the numeric position of the argument +2. Specify the entire text after the alias using ellipsis + +Examples: +``` +/alias "!speak" "/speak ..." +``` +When ``!speak`` alias is used, anything after it will be passed to the ``/speak`` command + +``` +/alias "!exp" "/calculate $1^2" +``` + +When ``!exp`` is used, the first argument (the first piece of text after the command ending with a space or a newline) is passed into the formula ``n^2``, which is then passed to the ``/calculate`` command.