Events System

Last updated: Mar 09th, 2017

Introductions

Use A.R.S To manipulate Echos actions when Events are triggered. This could range from when someone joins the server or a channel being created. Learn how to secure and use these formulas to better your community!

Event keys do have purpose inside Discord Howver they are mainly aimed towards the {json|} keys and web devs.


Sending Server info to your Website

Echo can update your website with information about your server!
All it takes is to understand the information Echo is sending and how to collect it.
You can learn more at Echo 4 Devs

Security Checks

It's important to protect any A.R.S Rule that involves an Event key.

Why protect?

Without protection people could run a key manually which is bad for this case.
{protect}
This key is your best friend when it comes to securing your event rules!
Make sure to add it to the beginning of any rule that's linked to an event!
Ok now let's move on..

Linking or Not?

When using the Event keys you will ask yourself, Should I link to another A.R.S Rule?
Well now you know how to protect both rules, so why not? What's the difference?

Running Direct

This way is the most efficient way and will take the least time to execute.
.auto jnevnt={init}
{protect}
{Event:Join}Welcome to {guild|name} {/user}!

Linking to another rule

This method will take a little longer however it allows for more complex systems.
Step 1
.auto jnevnt={init}
{protect}
{Event:Join}{ars:jnevnt2}
Step 2
.auto jnevnt2={init}
{protect}
/* Some more code to run with the Event. */
Welcome to {guild|name} {/user}!

Member Joins Server

.auto jnevnt={init}
{protect}
{Event:Join}Welcome to {guild|name} {/user}!

Member Leaves Server

.auto lvevnt={init}
{protect}
{Event:Leave}{redirect:CHANNELID}{/user} has left the building.

Member Update

.auto mupdb={init}
{protect}
{Event:MemberUpdate}{redirect:CHANNELID}
{/user} has changed something!
```
Nick: {usernick}
Username: {/user}
Roles
----
{listroles}
```

Role Create

When a role is created Discord only offers a few options. and the role name will always be new role.
.auto rcrdb={init}
{protect}
{Event:RoleCreate}{redirect:CHANNELID}
A role has been created.
/* you can use {rolename} but read above */

Role Delete

Discord only offers the Role ID When being deleted inside of Discord. So there are limitations if you're not using the json keys.
.auto rdldb={init}
{protect}
{Event:RoleDelete}{redirect:CHANNELID}
A role has been deleted.

Role Update

.auto rlupdb={init}
{protect}
{Event:RoleUpdate}{redirect:CHANNELID}
A role has been updated.

Channel Create

.auto chcrt={init}
{protect}
{Event:ChannelCreate}{redirect:CHANNELID}
A channel has been created.

Channel Delete

.auto chdl={init}
{protect}
{Event:ChannelDelete}{redirect:CHANNELID}
A channel has been deleted.

Channel Update

.auto chupd={init}
{protect}
{Event:ChannelUpdate}{redirect:CHANNELID}
A channel has been updated.

Server Update

.auto servupd={init}
{protect}
{Event:GuildUpdate}{redirect:CHANNELID}
The server has been updated.

Voice Update

.auto vjUpdate={init}
{protect}
{Event:VoiceUpdate}{redirect:CHANNELID}
String.{data|channel} == ?:{/user} has left voice.
Response.nil?:{/user} has joined <#{data|channel}>

Reaction Add

Variables available in this event: {data|channel}, {data|emoji}, {data|msgid}, {data|user} Note: You cannot use {protect} on this key.
.auto rctAdd={init}
{Event:ReactionAdd}
:break unless message.id=MessageIDHere
String.{data|emoji} == :smile:?:{/user} has voted for Option A
String.{data|emoji} == :frown:?:{/user} has voted for Option B
Response.nil?:{stop}

Reaction Remove

Variables available in this event: {data|channel}, {data|emoji}, {data|msgid}, {data|user} Note: You cannot use {protect} on this key.
.auto rctRemove={init}
{Event:ReactionRemove}
:break unless message.id=MessageIDHere
String.{data|emoji} == :smile:?:{/user} has removed their vote for Option A
String.{data|emoji} == :frown:?:{/user} has removed their vote for Option B
Response.nil?:{stop}