The Bible

Last updated: Mar 02, 2017

Introduction

Auto Response System was created to grant users the ability to have Echo perform complex tasks.
Almost like a Bot Bootstrap system for Discord.
The idea came from my original bot Paradox which was released early 2016 when everyone wanted
"Custom Commands".
The Auto Response System is very unique and allows for people to make things we weren't even aware were possible. This is where A.R.S Masters are born.

A.R.S Key List

The Basics

The Trigger

There are two parts to the ARS System. The Trigger and the Response
For most cases the trigger will be the word you want echo to react to when people say it.
The response will be what Echo sends back to the user. This is where majority of ARS Keys are used.

Basic Trigger:

.auto hello={init}
Response Here

The above rule will only work if the message is "hello"
Find Trigger:

.auto &hello={init}
Response Here

The above rule will find the word "hello" in a message.
Regex Trigger:

.auto &{:}(\n)={init}
Response Here

The above rule detects a rule with mult-lines in it using Regex.
Formulated Trigger:

.auto (word1|word2)={init}
Response Here

The above rule will only work if word1 and word2 is detected
Trigger Elements:

.auto <<HasPrefix?:Hello>>={init}
Hello to you too {/user}

Info: Basically this trigger will check all messages
and see if it starts with Hello. If so then echo will respond!

Params Key

Params key is one of the favorites in the system. It's the original key that allows you to catch someones input. Now there happens to be another key called {content} but that's for another time. Let's take a look at how we can use params in it's simplest form.

One of the neat things you can do is catch peoples text inside of a command.
And than you can handle that data inside of Echo's response to the user.
We make this possible by using the only ARS Key available inside of triggers.

Basic Example
.auto &.say {params}={init}
Hey You said {params} and let's do fun things with it below!
Another Example
.auto &.say {params}={init}
Normal Text: `{params}`
Backwards: `{params:flip}`
No Text: `{striptext:{params}}`
No Numbers: `{stripint:{params}}`

Splitting the Params key

.auto &.say {params}={init}
{split: }
You said `{/p0}` And also `{/p1}`
This will split your text into two by the delimiter which in this case is a space.
When using Params inside of your trigger, the trigger must always start with a &
However, you don't type the & when calling the command.

Params and Mentions

Echo will remove mentions from your params, the reason for this may not be clear for you yet.
But when you start dealing with custom role commands, or even games & Moderation commands it's needed.

Command Security

So from what you've learned so far, you're probably telling yourself
Hey, i could make a custom role command? Yes! You can. However..
Let's make sure by doing so. You don't allow your members to take your server over.

Bad Idea

.auto &.role {params}={init}
{role:{params}} Alright {/user} you now have the role `{params}`
Why is this bad?: The command above is not restricted
Which means any member could give themselves any role in your server.
Not Good at All!
Later down the road you will learn about statements which will help you out here
But we're in the basic tutorial of all this, So let me introduce you to the basic ways.
Now say you and your admins all have a role named Admin. Let's make the above
only work for people who have that admin role. Phew...
.auto &.role {params}={init}
{req:Admin}
{role:{params}} Alright {/user} you now have the role `{params}`
Yay! now the command is secured to only your Admins.
You could also secure it to multiple roles. {req:Admins,Management,Owner}
And there you go. A secure command so only your staff can call this command.

Now i bet you're wondering.. Can i type: .role @User Role Name using the above command?
The answer is YES! You really can. But before you dabble in this area.. let's move to th next part
Interact with Mentions which is just below. :)

Interact with Mentions

The cool thing is how echo handles a mention inside of a command
And what happens in the background, unless you restrict it yourself.

Custom role command

We'll start back with this command below to give yourself a role.
What is neat here is, it can also be used to give a mentioned user a role.
.auto &.role {params}={init}
{req:Admin}
{role:{params}} Alright {/user} you now have the role `{params}`
You Type: .role @User Role Name
Echo will immediately see the mention, remove it from the params (Yay!)
But that's not all. You will notice all of the keys have directed to the mentioned user
No longer says the users name who typed the command, instead it's all directed towards the mentioned.
This is also true for most of Echos keys, {kick}, {ban}, {user}, {rawid} all of the user based keys
This allows people to create custom commands, check other users info stats..etc so many possibilities!
I don't want mentions to be possible:
Not a problem at all, let's look at this nifty little key:
.auto &.role {params}={init}
{req:Admin}
{-mentions}
{role:{params}} Alright {/user} you now have the role `{params}`
No more Mentions! now if this command has a mention inside, Echo will ignore it completely.
He will still remove the mention from the params key, however. All of the keys are directed to the person
who triggered the rule. Not the mentioned user.. This is great to know for filtering words
You DO NOT want to do something like this:
.auto &fuck={init}
{kick}{/user} was kicked for swearing..
Why is this bad? because if they say Fuck and mention someone...uh oh..
Echo will now kick the mentioned user..not the person saying fuck.
So we do this:
.auto &fuck={init}
{-mentions}
{kick}{/user} was kicked for swearing..
Boom! Alright, now the user who just swore (regardless of mentions or not) will be kicked.
And the poor user who was just mentioned will not be harmed. Which is good..
This system also helps with games, moderation commands and much more.

The Power of Sleep

Learn how to manipulate when Echo performs a task!

.auto .test={init}
{sleep:15s} Hey you had to wait 15 seconds before seeing this!

Sleeping can be a great thing for many different reasons.
But you must understand that with sleeping, comes great responsibility...*Hehe*
There are what we call Sweet spots an ideal amount of time to sleep.
The reason for this is, Echo sometimes undergoes maintenance or updates.
If you have a command mid-sleep and Echo goes down for th above, no more command.
Echo will hault your command completely, and when he comes back. It won't start up again.
Now this is a small chance, but we managed to collect some data to find that 1 Hour
Should be the max amount of wait time {sleep:1h} for the best possible results.

Now, you can do some magic with a little thing we call ARS Linking and the sleep!
Read down below for more info!!

A.R.S Linking 101

The power of Linking two or more rules together!

ARS Linking is a lot of fun, and it allows you to do many more things with Echo.
The first thing you should know is, everyone is limited to 10 links in a rule.
And you cannot link a rule multiple times, or Echo will hault the entire rule.
.auto .test={init}
Alright, Here we go!
{ars:rule2}
Now in the linked rule, we will add {arslock} this will prevent people running it manually.
Now let's build the rule2 we're calling for inside of the {ars} key.
.auto rule2={init}
{arslock} /* Deny manual runs. */
{sleep:15s}
And there it went!!!

Now this system can be awesome for a few reasons, let's show you below:
Let's mute someone, and then have echo unmute them in 30 minutes.
This requires you to have the role Muted
.auto &.mute={init}
{role:Muted}{/user} has been muted.
{ars:unMute}
You type: .mute @User
.auto unMute={init}
{arslock}
{sleep:30m}
{take:Muted}Alright {/user} you can now talk.
Awesome! Now let's explain a little bit of what's happening above.
You typed out .mute @MentionSomeoneHere and Echo immediately mutes them
Now, he will wait 30 minutes and then unmute the user, letting them know he's unmuted.
One thing you should know is all responses will be sent back to the channel you've initiated the command.

A.R.S Statements 101

Statements will help you with many different possibilities
They allow you to tell Echo to stop, or go. Based on a condition.
Let's look at some examples below!

We will start you off with the newest of the statements.
We call them Conditionals.
.auto &.say {params}={init}
:break unless params=Hello!
Hey, you said `Hello` :)
Now with the conditionals you can also have else conditions.
.auto &.say {params}={init}
:break unless params=Hello! >> Sorry, you need to type .say Hello
Hey, you said `Hello` :)
Pretty neat, so if you type .say Goodbye you will get the else response
Sorry, you need to type .say Hello

Seems pretty simple right? Let's look at the Basic Statements
These were the first of the Statements.
.auto &.say {params}={init}
{if:params == Hello}
Hey, you said `Hello` :)
Alright, now let's take a look at Dynamic Statements
Which also give you the ability to have Else conditions :)
.auto &.say {params}={init}
Params.Hello?:Hey, you said `Hello` :)
Response.nil?:Sorry, you need to type .say Hello
Awesome! Now let's take a look at Complex Statements
Which also give you the ability for else conditions.
.auto .test={init}
use | general | noob-channel
{if(ischannel):
   Hey, you typed this command in #general or #nooob-channel
} (else) {
   {stop} /* tell echo to do nothing */
}
Now let's explain a little bit about above.
We're checking if the command was typed out in two channels
If not then we're telling echo to just stop.
This can also be done without using the else condition all together.
.auto .test={init}
use | general | noob-channel
{if(ischannel):
   Hey, you typed this command in #general or #nooob-channel
}