Robtic Docs robtic.org
Robtic RulesThe language

Settings (inputs)

Every input becomes one setting on the plugin's settings page. Types, defaults, required settings and tables.

Each input line becomes one setting on the plugin's settings page in the dashboard. Rules read it as input.<name>. The server fills them in; your code never names a role or a channel itself.

plugin "Welcome" for system
version 1

## Where the welcome message goes.
input channel: channel "Welcome channel" required
input message: text = "Welcome to the server, {member.mention}!" "Message"
input color: color = #1793ff "Colour"
input banner: image "Banner"
input role: role "Role for new members"
input delay: duration = 5m "Wait before giving the role"
input ping: bool = off "Mention them outside the embed too"

Open Settings page to see how each type is drawn.

Writing an input

input <name>: <type> [= <default>] "<label>" [required]

PartMeaning
<name>What rules call it: input.channel
<type>What kind of setting (below)
= <default>The value before the server changes it
"<label>"What the settings page shows. Can be two languages: en "Channel" ar "الروم"
requiredThe plugin can't be switched on until this is filled
## … above itHelp text under the setting

Types

Input typeThe setting looks likeValue in rules
texttext boxtext
number, percent, durationnumber box with its unitthat type
boolswitchbool
colorcolour pickercolor
emojiemoji pickeremoji
imagepicture uploadthe picture, for an embed's image or thumbnail
role / rolesrole picker / several rolesrole / list of roles
channel / channelschannel picker / severalchannel / list of channels
wordstall list, one per linelist of text
tablerows with columns and an Add buttontable (below)
  • Text the server types can hold values too: Thanks, {member.mention}! is filled when the rule runs.
  • image, role(s) and channel(s) can't have a default: the server uploads or picks them.
  • An empty setting skips its part. Sending to an empty channel setting does nothing, giving an empty role setting gives nothing, unless the setting is required.

Tables

A table is a list of rows the server builds, each with the same columns. List the columns indented under the input:

plugin "Rewards" for system
version 1

input rewards: table "Reward roles"
  days: number "Days"
  role: role "Role"
  • input.rewards.days is the list of every row's days.
  • tier roles input.rewards at member.streak gives the role of the highest row reached (see Actions).
  • lookup(input.rewards.role, input.rewards.days, 30) finds one value by another.

Columns can be text, number, duration, role, channel, emoji, member (a Discord user ID) and image.

Rows are events

When the server adds a row on the settings page, a rule when row_added "<table>" runs once for that row, with it as row. row_edited and row_removed (the row as it was) work the same way.

plugin "Partners" for system
version 1

input channel: channel "Partners channel" required
input role: role "Representative role"
input partners: table "Partners"
  name: text "Server name"
  representative: member "Representative"
  banner: image "Banner"

store row.post: text

rule "Announce a new partner"
when row_added "partners"
then
  send components {
    title: "{row.name}"
    image: row.banner
  } to input.channel as row.post
  give role input.role to row.representative

rule "Remove a partner"
when row_removed "partners"
then
  delete row.post
  take role input.role from row.representative

The first time the engine sees a table it only notes the rows already there, so installing a plugin never re-announces them. send … as row.post keeps the message, so a later edit updates it instead of posting again.

Robtic SystemAPPToday at 12:00
Arab Gamers