Statements

Last updated: Feb 21st, 2018

Introductions

Statements were originally created shortly after the A.R.S to allow for more function. Over the time the simple statements have evolved into Complex or Dynamic Statements. All of which can be learned on this page.

Conditional Statements

Conditional statements have the ability for single or multiple line else conditions.
They also allow for single objects or an array of objects.

Example (Single):

.auto .test={init}
:break unless user.has_role=Admin
Hey {/user} you have the Admin role!

Example (Array):

.auto .test={init}
:break unless user.has_role=["Admin", "Management", "Support"]
Hey {/user} you have one of these roles `Admin, Management or Support`!

Example (Else Condition):

.auto .test={init}
:break unless user.has_role=Admin >> Sorry {/user} you don't have Admin role.
Hey {/user} you have the Admin role!

Example (Multi-line Else Condition):

.auto .test={init}
:break unless user.has_role=Admin >> Sorry {/user} you don't have Admin role.
But you can always ask our staff member
if you wish to join our team :) <<
Hey {/user} you have the Admin role!

- Message Detection

Check for message id.
.auto reactAdd={init}
{Event:ReactionAdd}
{protect}
:break unless message.id=14556855595686999965
String.{data|emoji} == :smile:?:You just smile at me {/user}!
Response.nil?:{stop}
Event: this rule will only be triggered on Reaction Add Event

- User ID Detection

Check for user id
.auto .test={init}
:break unless user.id=1456565865654654354
What is up {/user}!

- User Role Detection

Check if user has role.
.auto .test={init}
:break unless user.has_role=Admin
Hey {/user}! You have the role `Admin`

- Username Contains

Check for word in username
.auto .test={init}
:break unless user.has=Josh
Hey {/user} you have Josh in your name!

- Username Starts With

Check if username starts with word
.auto .test={init}
:break unless user.starts_with=P
Your name starts with a P `{/user}`

- Username Ends With

Check if username ends with word
.auto .test={init}
:break unless user.ends_with=y
Your name ends with a y `{/user}`

- Channel ID

Check for a specific channel
.auto .test={init}
:break unless channel.id=1254354135413541353
Hey {/user} you types this command in #general channel.

- Params Check

Check params for a word
.auto &.test {params}={init}
:break unless params=Hello
You said Hello!

- Params Starts With

Check if params starts with a word
.auto &.test {params}={init}
:break unless params.starts_with=Hello
You said Hello!

- Params Ends With

Check if params ends with a word
.auto &.test {params}={init}
:break unless params.ends_with=Hello
You said Hello!

- Params Contains

Check if params contains a word
.auto &.test {params}={init}
:break unless params.has=Hello
You said Hello!

Dynamic Statements

- Role Detection

Check if a user has a role.
.auto .isRole={init}
Role.Role Name1?:{/user} You have the role Role Name1
Role.Role Name2?:{/user} You have the role Role Name2
Response.nil?:You don't have either Role 1 or Role 2
You Type: .isRole

- User Detection

React different based on the user.
.auto .isUser={init}
User.UserDiscordIDHere?:{/user} You are the user x1
User.UserDiscordIDHere?:{/user} You are the user x2
User.UserDiscordIDHere?:{/user} You are the user x3
Response.nil?:You are not allowed to use this command.
You Type: .isUser

- Channel Detection

Check for a specific channel
.auto .isChannel={init}
Channel.general?:{/user} This is a reaction for Channel X1
Channel.nsfw?:{/user} This is a reaction for Channel X2
Channel.channel-name?:{/user} This is a reaction for Channel X3
Response.nil?:{stop} /* Does nothing if the command is not form X1,X2,X3 */
You Type: .isChannel

- Params Detection

Check for specific text in params.
.auto &.test {params}={init}
Params.Hello?:Hello, {/user}!
Params.Gross?:{/user} I'm not gross!! :(
Response.nil?:I couldn't understand what you said!
You Type: .test Hello
You Type: .test Gross

- Params Regex Detection

Check for specific regex expression from params.
.auto &.test {params}={init}
ParamRegex.(a{3,6})?:You said a 3 - 6 times
ParamRegex.(b{3,6})?:You said b 3 - 6 times
Response.nil?:I coudldn't understand the input.
You Type: .test aaa
You Type: .test bbb

- Content Detection

Check for specific text in Content.
.auto &.test={init}
{clean}
Content.Hello?:You said Hello!
ContentContains.cat?:You said cat!
Response.nil?:Nothing came of this...
You Type: .test Hello
You Type: .test Testing cat!

- Content Regex Detection

Check for regex expression in Content.
.auto &.test={init}
{clean}
ContentRegex.(a{3,6})?:You said a 3 - 6 times
ContentRegex.(b{3,6})?:You said b 3 - 6 times
Response.nil?:I couldn't understand the input.
You Type: .test aaa
You Type: .test bbb

- Nickname Detection

Check for specific text in nickname.
.auto &.test={init}
Nickname.Monster Cat?:Your nickname is Monster Cat!
Nickname.Bob?:Your nickname is Bob!
NicknameContains.Hex?:Your nickname contains the word Hex!
Response.nil?:{stop} /* Do nothing if above is not found */
You Type: .test

- Day Detection

Check for specific day.
.auto .test={init}
Day.Friday?:Hey it's Fridat!
Day.Saturday?:Partaaay time!!
Response.nil?:This command is sleeping.
You Type: .test

- Hour Detection

Check for specific hour.
.auto .test={init}
Hour.5?:It's 5am!
Hour.17?:It's 5pm!
Response.nil?:This command is sleeping.
You Type: .test

- Minute Detection

Check for specific Minute.
.auto .test={init}
Minute.15?:It's 15 past x!
Minute.10?:It's 10 past x!
Response.nil?:This command is sleeping.
You Type: .test

- Timezeone Manipulation

Set the Timezone for all time based A.R.S and D.S.S Keys. View Timezones
.auto .stamp={init}
Timezone.America/New_York?
Time.Now > Hour.13?:It's past 1pm in new york!
You Type: .stamp

- Time Statements

React based off different times.
.auto .test={init}
Time.Now > Hour.3?:It's past 3am!
Time.Now >= Hour.15?:It's past 3pm!
Time.Now <= Hour.12?:It's before or equal to noon!
Time.Now < Hour.12?:It's before noon!
Time.Now == Hour.13?:It's 1pm!
Response.nil?:Command is sleeping.
You Type: .test

- Counting Statements

React based off x ? x.
.auto .test={init}
Count.X >= Y?:X is higher than or equal to Y!
Count.X == Y?:X is equal to Y!
Count.X > Y?:X is higher than Y!
Count.X < Y?:X is lower than Y!
Count.X <= Y?:X is lower than or equal to Y!
Response.nil?:Command is sleeping.
You Type: .test

- Global Var Statements

Check to see if a Global Variable Exists or not.
.auto .test={init}
Globals.VarName?:Global Variable {.VarName} Exists!
Response.nil?:The Global Variable `VarName` does not exist.
You Type: .test

- Params Replace

Replace text in Params.
.auto &.test {params}={init}
Replace.Hello?:Goodbye!
You said `{params}`
/* Type .test Hello */
You Type: .test Hello

Complex Statements

- Channel(s) Detection

Check for a Channel or Channels by the Discord ID or Name.
.auto .isChannel={init}
use | general | nsfw
{if(ischannel):
    {/user} Found the right channel.
}

Another Way

.auto .isChannel={init}
use | DiscordID | DiscordID
{if(ischannel):
    {/user} Found the right channel.
} (else) {
    {/user} Posted in the wrong channel.
}
You Type: .isChannel

- User(s) Detection

Check for a User or Users by Their Discord ID.
.auto .isUser={init}
use | 146046383726657536
{if(isuser):
    {/user} can use this command!
}

Another Way

.auto .isUser={init}
use | 146046383726657536 | 2156553266565364564
{if(isuser):
    {/user} can use this command!
} (else) {
    {/user} doesn't have access to this command.
}
You Type: .isUser

- Role(s) Detection

Check user for a Role or Roles.
.auto .hasRole={init}
use | Admin
{if(hasrole):
    {/user} has the role Admin
}

Another Way

.auto .hasRole={init}
use | Admin | Team Instinct | Valor
{if(hasrole):
    {/user} has the role Admin
} (else) {
    {/user} doesn't have the role Admin
}
You Type: .hasRole

- Username Detection

Check if a username contains word(s)
.auto .checkUser={init}
use | noob | hex | fudge
{if(user|contains):
    {/user} contains the words in their username!
}

Another Way

.auto .checkUser={init}
use | noob | hex | fudge
{if(user|contains):
    {/user} contains the words in their username!
} (else) {
    {stop}
}
You Type: .checkUser

- Nickname Detection

Check if a nickname contains word(s)
.auto .checkNick={init}
use | noob | hex | fudge
{if(nick|contains):
    {/user} contains the words in their nickname!
}

Another Way

.auto .checkNick={init}
use | noob | hex | fudge
{if(nick|contains):
    {/user} contains the words in their nickname!
} (else) {
    {stop}
}
You Type: .checkNick

Basic Statements

Simple statements work with two different conditions == or !=

- User Detection

Check for user.
.auto .checkUser={init}
{if:user == Proxy}
{/user} is Proxy!
You Type: .checkUser

- Channel Detection

Check for Channel.
.auto .checkChannel={init}
{if:channel == general}
{/user} this is #general channel.
You Type: .checkChannel

- Params Detection

Check Params.
.auto &.check {params}={init}
{if:params == hello}
{/user} you said hello! /* type .check Hello */
You Type: .check hello