Robtic Docs robtic.org
Robtic RulesStart here

The basics

How a plugin file is laid out, the header, and the values and types the language works with.

How a file is laid out

A plugin reads top to bottom: a header, its settings, what it stores, its rules, and its tests.

  • Comments start with # and run to the end of the line. # followed by 3 or 6 hex digits is a colour (#f97316), not a comment.
  • Help text starts with ## on the line(s) just above a setting.
  • One statement per line. A short list of actions can share a line with commas: then delete, warn "No links".
  • Indentation makes blocks, like Python: what's under then, under an if or inside a test is indented the same amount (2 spaces). Tabs aren't allowed.
  • Inside brackets ( ), [ ] and { } lines can break freely.
  • Names (claim_every, last_text) are lowercase letters, digits and _, starting with a letter.
  • Keywords are English. Text members see can be in any language.

The header

plugin "Streaks" for system
version 1
icon "flame"
description en "Daily message streaks." ar "سلاسل الرسائل اليومية."
LineRequiredMeaning
plugin "<name>" for <bot>yes, firstThe name, and the bot it runs with: system, ticket, staff, guard, voice
version <n>yesA whole number from 1, raised with each published change
icon "<name>"noAn icon from the dashboard's set (flame, rocket, users…)
description <text>noShown in the plugin library; can be in two languages

There's no author line: the author is the account that publishes it.

Values and types

Every value has a type, and mixing them up is an error you see while typing ("claim_every is a duration; it can't be compared with a number").

TypeWrite it asNotes
number5, 2.5, -3
percent70%
duration10s 5m 1h 2d 1w2.5h works too
timenow, member.last_ata moment
datetoday, yesterdaya whole day (UTC)
text"hello", en "Hi" ar "أهلًا"{…} inside puts values in
boolon off yes no true falseall the same two values
color#f97316, #fff
emoji:fire:or the emoji itself inside text
role, channel, memberfrom settings, options and eventsnever written by name
list of X[1, 7, 30], input.channels
tablea setting with columnssee Settings

Arithmetic

Only arithmetic that makes sense works; the rest is an error.

ExpressionResult
number + number, -, *, /number
time + duration, time - durationtime
time - timeduration
date + duration, date - durationdate
date - dateduration (whole days)
duration + duration, duration - durationduration
duration * number, duration / numberduration
text + anythingtext
if now - member.last_at < 10s
then reply "Slow down a little."