Rule format
An automation rule can be written by hand and loaded as a file: “Automations → New rule → Load from file”. Here are all the fields, allowed values and limits. A loaded rule arrives turned off: check it in the editor and turn it on.
File
A JSON file (UTF-8 encoding) like this:
{
"format": "paperbot-automation",
"guild_id": "123456789012345678",
"rule": {
"name": "Remind the author and close",
"trigger": { "type": "author_silent", "minutes": 1440 },
"conditions": [
{ "type": "status", "value": "open" },
{ "type": "paused", "value": false }
],
"actions": [
{ "type": "message", "text": "{user}, is the question still relevant?",
"buttons": [
{ "key": "stillneed", "label": "Yes, I need help", "style": "primary", "who": "author" }
] },
{ "type": "wait", "minutes": 1440 },
{ "type": "close", "reason": "The author didn't reply" }
]
}
}| Field | What it is |
|---|---|
format | Always paperbot-automation. Any other file won’t be accepted. |
guild_id | The ID of the server the rule was written for, as a string. It’s the number in the web panel address after /dashboard/. If it’s missing or names another server, the rule’s roles and channels are dropped (see “What is checked”). |
rule.name | The name, up to 100 characters. Empty — “Untitled”. |
rule.group | Optional. A group in the rule list, up to 60 characters: rules with the same group sit as one block. Missing or empty — no group. |
rule.trigger | When it fires — one object, triggers. |
rule.conditions | If — a list, up to 20 conditions, all must be met; can be empty. Conditions. |
rule.actions | What to do — a list, from 1 to 10 steps in order. Actions. |
Where to get IDs
- •Server — the number in the web panel address:
/dashboard/ID/…. - •Ticket category — the number in its page address:
/dashboard/…/categories/ID. - •Role and channel — the ID on Lolka. IDs are always written as a number or a string of digits.
- •Custom button — a key you make up yourself: 4–16 characters, lowercase Latin letters and digits (
stillneed,helped1).
Triggers (rule.trigger)
The type field is required, the rest per the table. Timer minutes are from 5 to 43200 (30 days).
opened- When
- Ticket opened
- Fields
- —
first_staff_reply- When
- First staff reply
- Fields
- —
claimed- When
- Ticket claimed
- Fields
- —
unclaimed- When
- Ticket unclaimed
- Fields
- —
closed- When
- Ticket closed
- Fields
- —
reopened- When
- Ticket reopened
- Fields
- —
rated- When
- Rating given
- Fields
- — (which one — with the rating condition)
button- When
- Custom button pressed
- Fields
button— the button key (required)
message- When
- A message in an open ticket
- Fields
from:any|author|staff(any by default);match: empty (any),containsorregex;text— what to look for, up to 200 characters (for contains, options separated by|, case-insensitive);once: true — once per ticket (true by default);files: true — only messages with an attachment (false by default)
priority_changed- When
- Priority changed
- Fields
to:low|medium|highor empty — any
moved- When
- Moved to category
- Fields
category_id— a category ID or empty — any
author_left- When
- The author left the server
- Fields
- —
role_changed- When
- The author got or lost a role
- Fields
role_ids— up to 10 role IDs (required);change:added|removed(added by default)
crowded- When
- Open tickets in a category went above N
- Fields
count— from 1 to 500 (required);category_idor empty — any
participant- When
- Member added or removed (the member is the one who triggered it)
- Fields
change:any|added|removed(any by default)
pause_ended- When
- Auto-close pause ended (ran out or was lifted)
- Fields
- —
staff_left- When
- The staff member who claimed the ticket left the server
- Fields
- —
command- When
- A custom command was used in the ticket
- Fields
name— the command name without the prefix, up to 32 characters, or empty — any
manual- When
- A manual run from the web panel (inbox, “⋯” → “Run a rule”)
- Fields
- —
author_silent- When
- The author has been silent this many minutes
- Fields
minutes(required)
staff_silent- When
- Staff have been silent this many minutes
- Fields
minutes(required)
unclaimed_for- When
- Nobody claimed it for this many minutes
- Fields
minutes(required)
open_for- When
- Open for longer than this many minutes
- Fields
minutes(required)
A regex in message is case-insensitive, with no more than one repeat (*, +, {n,m}) and no more than 8 alternatives (?, a|b); the first 1000 characters of the message are checked.
Conditions (rule.conditions)
Each condition is an object with a type. Where there’s op: gte — “at least”, lte — “at most”. A condition with an empty required field is dropped.
category- Checks
- The ticket's category
- Fields
op:in|not_in;value— a list of category IDs
status- Checks
- Status
- Fields
value:open|closed
claimed- Checks
- Whether the ticket is claimed
- Fields
value: true | false
priority- Checks
- Priority
- Fields
value— a list oflow,medium,high
author_role- Checks
- Author role
- Fields
op:has|has_not;value— a list of role IDs
claimer_role- Checks
- Claimer role
- Fields
op:has|has_not;value— a list of role IDs
rating- Checks
- Rating
- Fields
op:gte|lte;value— from 1 to 5
waiting- Checks
- Who the ticket is waiting for
- Fields
value:staff(a staff reply) |author
hours- Checks
- Support hours
- Fields
value:in(working hours now) |out
answer- Checks
- An answer in the opening form
- Fields
question— the question text (up to 100, empty — any question);contains— what the answer contains (up to 200, required)
paused- Checks
- Auto-close pause
- Fields
value: true | false
time- Checks
- Day and time (the zone from “Support hours”, Moscow by default)
- Fields
days— a list ofmon…sun(empty — all days);from,to— “HH:MM”. Days or both times are needed
author_open- Checks
- The author's open tickets
- Fields
op;value— from 1 to 100
messages- Checks
- Messages in the ticket
- Fields
op;value— from 0 to 10000;from:any|author|staff
age- Checks
- How long the ticket has been open
- Fields
op;minutes— from 1 to 525600
reopens- Checks
- How many times it was reopened
- Fields
op;value— from 0 to 1000
member_for- Checks
- How many days the author has been on the server
- Fields
op;value— from 0 to 3650
Actions (rule.actions)
Steps run in order, up to 10 in the list and in each branch. Texts are up to 2000 characters, and placeholders work in them. A step with an unknown type is dropped; a step without a required field is a load error with an explanation.
message- What it does
- Post in the ticket
- Fields
text;buttons— up to 5 custom buttons (text or buttons are needed);pin: true — pin it;role_ids— up to 10 roles to ping
channel_message- What it does
- Post in a channel
- Fields
channel_id,text(both required);role_ids— ping
reply_template- What it does
- Reply from a template
- Fields
name— the name of a reply template from the “Commands” section, up to 50
close- What it does
- Close the ticket
- Fields
reason— up to 500
delete_channel- What it does
- Delete the channel (an open ticket is closed first)
- Fields
- —
reopen- What it does
- Reopen
- Fields
- —
priority- What it does
- Priority
- Fields
value:low|medium|high
move_category- What it does
- Move to category
- Fields
category_id
rename- What it does
- Rename the channel
- Fields
name— up to 100
create_voice- What it does
- The ticket's voice channel (not created twice)
- Fields
name— up to 100 (empty — “🔊 number”);category_id— a channel category (empty — where the ticket channel is);empty_minutes— from 1 to 1440: delete when everyone has left and this many minutes have passed; null — only together with the ticket
delete_voice- What it does
- Delete the ticket's voice channel
- Fields
- —
claim_actor- What it does
- Claim the ticket for whoever pressed the button
- Fields
- —
unclaim- What it does
- Unclaim
- Fields
- —
pause- What it does
- Auto-close pause
- Fields
hours— from 1 to 720; 0 — lift the pause; null — no end
ask_rating- What it does
- Ask for a rating
- Fields
- —
add_role- What it does
- Give the author a role
- Fields
role_ids— up to 10
remove_role- What it does
- Take a role from the author
- Fields
role_ids— up to 10
add_to_ticket- What it does
- Give access to the ticket
- Fields
role_idsand/oractor: true — to whoever triggered the rule
remove_from_ticket- What it does
- Take away access to the ticket
- Fields
role_idsand/oractor: true
mute_author- What it does
- Stop the author from writing
- Fields
minutes— from 1 to 43200; null — until the “allow” step
unmute_author- What it does
- Let the author write
- Fields
- —
blacklist_author- What it does
- Blacklist
- Fields
hours— from 1 to 8760 or null — forever;reason— up to 500
unblacklist_author- What it does
- Remove from blacklist
- Fields
- —
kick- What it does
- Kick the author from the server
- Fields
reason— up to 500
ban- What it does
- Ban the author
- Fields
reason— up to 500
unban- What it does
- Unban the author
- Fields
reason— up to 500
webhook- What it does
- A POST to an external service
- Fields
url— https, a public address;format:json|message;text— required for message
remove_buttons- What it does
- Remove the buttons from the message that was pressed
- Fields
- —
stop_rules- What it does
- Don't run further rules for this event
- Fields
- —
wait- What it does
- Wait before the next steps
- Fields
minutes— from 1 to 43200
repeat- What it does
- Repeat
- Fields
every_minutes— from 5 to 43200;times— from 1 to 10;while— conditions (as inconditions) that must hold;actions— what to repeat (no wait or repeat)
if_else- What it does
- If / else
- Fields
conditions— at least one;then,else— lists of steps (at least one not empty)
Custom button (in message.buttons)
| Field | Values |
|---|---|
key | 4–16 characters: a–z and 0–9. The rule for this button is a button trigger with the same key. |
label | The label, up to 80 characters (a label or an emoji is needed). |
emoji | An emoji, up to 64 characters. |
style | primary | secondary | success | danger (secondary by default) |
who | Who can press it: author | staff | all (all by default) |
Nesting
- •
if_elsecan go insiderepeator inside another top-levelif_else— no deeper. - •
repeat— only at the rule’s top level; nowaitorrepeatinside it.
What is checked on load
- •The rule arrives turned off — turn it on in the editor after checking (“Check”, “Dry run on a ticket”).
- •If
guild_iddoesn’t match the server you load it on, or is missing, another server’s roles and channels are dropped: the “Post in a channel”, “Give a role”, “Take a role” steps and theauthor_role,claimer_roleconditions are removed,messageloses its ping roles,add_to_ticketandremove_from_ticketlose their roles (the step stays if it hasactor: true). - •Categories that don't exist on this server are dropped: from conditions, from “Move to category”, from the “Moved to category” trigger (it becomes “any”).
- •Unknown fields are thrown away, numbers are trimmed to the limits. Without a trigger or without a single action the rule won't load — the error says what's missing.
- •Ban, kick, unban, roles and ticket access can be turned on only by the server owner or a Lolka administrator.
- •No more than 25 rules per server.
