Snippets

Last updated: Feb 26th, 2018

Introductions

The system was created for people who wanted to have entertainment commands without learning the A.R.S. These are pre-built commands that need to be installed in your Server!

You will also have access to the snippet list inside of Discord.

Type: .snippet -list and an available list of public snippets will appear in your chat.

Now find the snippet (For Example: AntiDiscordLinks) and type: .snippet AntiDiscordLinks

And a copy of the snippet will become available for download (As long as echo can upload files)

Installing

Save the command you wish to be installed on your computer (Right click a link below and "Save link as..")
Make sure not to change the file name or this won't work!

In your Discord Server where Echo can read messages drag the downloaded file to Discord (Upload snippet file) You will be notified if the command was installed correctly!
You can type the command and test it out!

Command List

Command Download Short Desc
.server Download! An embed server info command
.whoami Download! An embed whoami command
.sky Download! Random sky images
.space Download! Random space images
.dbz Download! Random dbz images
.ass Download! Random ass images
.boobs Download! Random boobs images
.cute Download! Random cute images
.cars Download! Random cars images
ALL [Safe] Combined Download! All of these commands besides NSFW.

Information

   _____       _                  _      _____           _                   ___    ___  
  / ____|     (_)                | |    / ____|         | |                 |__ \  / _ \ 
 | (___  _ __  _ _ __  _ __   ___| |_  | (___  _   _ ___| |_ ___ _ __ ___      ) || | | |
  \___ \| '_ \| | '_ \| '_ \ / _ \ __|  \___ \| | | / __| __/ _ \ '_ ` _ \    / / | | | |
  ____) | | | | | |_) | |_) |  __/ |_   ____) | |_| \__ \ ||  __/ | | | | |  / /_ | |_| |
 |_____/|_| |_|_| .__/| .__/ \___|\__| |_____/ \__, |___/\__\___|_| |_| |_| |____(_)___/ 
                | |   | |                       __/ |                                    
                |_|   |_|                      |___/                                     

All of the information inside of this snippet is designed to help you undertstand the new Snippet 2.0. And methods that will help you throughout this system.

First lets look at the new Config system.

This system will create variables inside of a snippet. I myself have made some huge snippets.
Some maxing out to 5k+ lines of code (Dragon Wars). What if there was a system to make everything easier?
The config system will hold "Variables" inside of the snippet, that you can use through all ARS Rule.
When the user drags the snippet over, echo will replace the variables with the value.
Lets take a look below to see how this works.

[CONFIG]
user=146105465516846686
Message=What is up {/user}! Hope all is well!! :)
[/CONFIG]

.test={init}
:break unless user.id=$user
$Message
Pretty neat huh? Basically we created 2 variables
user which holds the users id.
And message, which holds the message of the .test command
We can actually step it up, lets parse a variable inside of another variable.

[CONFIG]
user_id={/rawid}
joinMessage=Welcome to {guild|name} <@$user_id>. We hope you enjoy your stay.
[/CONFIG]

jnEvent={init}
{Event:Join}{pm}
$joinMessage
So basically (And for no real reason at all) we stored {/rawid} into the variable "user_id"
from there, we created a joinMessage and placed the variable inside "Waiting to be parsed".
Now, when users join your server. They will recieve the joinMessage with their name mentioned
within the message.

Snippet IF System (And why it will one day rule the world)

The cool thing about this internal IF system is you can give people the option of what to install.
Using the Config along with the IF system, you can make one snippet hold many things. And yet
give everyone the ability to pick what they want to do inside of their code.

[CONFIG]
useFooter=True
useFooterText=True
useFooterImage=True
embedTitle=Welcome {/user}!
embedDescription=Testing some stuff out with the new snippet system!
footerText=Hello, Have a good day!
footerImage=https://proxikal.github.io/Echo/favicon-new.png
[/CONFIG]


.embed={init}
{embed:
    {title:$embedTitle}
    {desc:$embedDescription}
    [IF $useFooter == 'True']
        [IF $useFooterText == 'True']{footer|text:$footerText}[/IF]
        [IF $useFooterImage == 'True']{footer|icon:$footerImage}[/IF]
    [/IF]
}

Pretty neat huh? Now currently since this system is early beta, the if statements can make your code look a little messy. but that will be cleaned up in time.

Database Manipulation (2.0)

Before we only had the option to create a database. Which was alright, but what if we wanted access to more..
With the new Database system, not only can you control how the database is being created, you also can install variables.

We will start with the basic setup. This setup will create the database if it exists, or write to an existing database.
We will pretend to use the database UserProfiles and create 2 variables inside of it (OwnerID, OwnerName)

[TASK]
for::UserProfiles
OwnerID=1465561656835665665
OwnerName=Proxy
[/TASK]
And, done.. When the snippet is installed Echo will make 1 Database (Unless it exists already) and then install 2 variables to the database.
But, what if you wanted more control? Say the user already has a database with that name, and you don't want to configure it.
Let's show you how to make a database (As long as it doesn't exist)

[TASK]
for::UserProfiles::DEFUNCT
OwnerID=1465561656835665665
OwnerName=Proxy
[/TASK]
Notice how we added ::DEFUNCT to the end of your database name?
This tells echo to only create the database if it doesn't exist.
Now we can do the same but, only install the variables if the database already exists

[TASK]
for::UserProfiles::EXISTS
OwnerID=1465561656835665665
OwnerName=Proxy
[/TASK]
Awesome! Now you know the three different modes inside of Database Manipulation.
For now that is all we have. We're not stopping though! We're thinking of much more to add
So don't forget to keep checking back for new updates!