Robtic Docs robtic.org
Robtic RulesReference

Reference

Every field of member, message, channel and server, the limits, and the full grammar.

Fields

member.

FieldType
id name mentiontext
avatarimage: their picture (for an embed's thumbnail or image)
is_bot is_admin is_booster timed_outbool
was_timed_outbool, in member_update
account_age joinedduration (since the account was made / since they joined)
roleslist of roles
has_role(r)yes if they have that role (or any role of a list)
level warningsnumber (Robtic System)
tag tag_beforetext: the ID of the server whose tag they wear ("" for none). member.tag = server.id is "wears this server's tag"
messages(10s) strikes("name", 1h)number in that window
any store member. fieldits type

message.

FieldType
content languagetext (language: ar, en or other)
length words lines emoji_count mention_count role_mentions link_count invites attachmentsnumber
caps_ratiopercent
linkslist of text (domains)
has_image is_reply is_forwardedbool
matches(regex)bool

channel. and server.

channel.id name mention (text) · is_nsfw (bool) · messages(5s) (number)
server.id name (text) · member_count boosts boost_level (number) · joins(10s) (number) · raid_mode (bool) · any store server. field

Limits

Rules30
Commands5
Forms3, with 5 fields each
Settings (inputs)25
Store keys20 (1 KB per member, 64 KB per server)
Lists10, 5000 entries in all
Regex50, 260 characters each
Schedules1, at most every 10 minutes
Timersup to 30 days, 1000 waiting
if depth3
Messages sent20 a minute; DMs 5 a minute
Role changes30 a minute
Work per event20,000 steps across all rules

Grammar

file        = { decl } ;
decl        = header | input | list | store | check | command | form | rule | test | migrate ;
header      = "plugin" TEXT "for" NAME NL | "version" NUMBER NL | "icon" TEXT NL | "description" text NL ;
input       = { "##" DOC NL } "input" NAME ":" type [ "=" expr ] text [ "required" ] NL [ INDENT { column } DEDENT ] ;
column      = NAME ":" type text NL ;
list        = "list" NAME "=" "[" [ TEXT { "," TEXT } ] "]" NL ;
store       = "store" ( "member" | "server" | "row" ) "." NAME ":" type [ "=" expr ] NL ;
check       = "check" NAME "=" expr NL ;
command     = "command" TEXT text NL [ INDENT { "option" NAME ":" type text [ "required" ] NL } DEDENT ] ;
form        = "form" TEXT text NL INDENT { "field" NAME ":" type text [ "required" ] NL } DEDENT ;
rule        = "rule" TEXT NL "when" event NL [ "if" expr NL { ( "and" | "or" ) expr NL } ] "then" ( NL block | stmts NL ) ;
event       = NAME [ TEXT ] [ "in" expr ] | "schedule" "every" DURATION [ "at" TEXT ] ;
block       = INDENT { stmt NL } DEDENT ;
stmts       = stmt { "," stmt } ;
stmt        = "let" NAME "=" expr | "set" path "=" expr | "clear" path | if | action ;
if          = "if" expr ( "then" stmts | NL block ) [ NL "else" ( if | stmts | NL block ) ] ;
test        = "test" TEXT NL INDENT { given | "let" NAME "=" expr | twhen | "wait" expr | expect } DEDENT ;
migrate     = "migrate" "from" NUMBER NL block ;
expr        = or ;  or = and { "or" and } ;  and = not { "and" not } ;  not = "not" not | cmp ;
cmp         = sum [ cmpop sum ] ;  sum = prod { ("+"|"-") prod } ;  prod = unary { ("*"|"/") unary } ;
unary       = "-" unary | postfix ;  postfix = primary { "." NAME | "(" [ expr { "," expr } ] ")" } [ "as" TEXT ] ;
primary     = NUMBER | PERCENT | DURATION | text | COLOR | EMOJI | BOOL | "now" | "today" | "yesterday" | "here"
            | NAME | "(" expr ")" | "[" [ expr { "," expr } ] "]" | "if" expr "then" expr "else" expr ;
text        = TEXT | "en" TEXT "ar" TEXT | "ar" TEXT "en" TEXT ;