Limits
A script runs on a shared server, so every run has a budget. When a limit trips, the script leaves by «ошибка» (error), with the text in $script_error.
A run
| What | Limit | «Доступ студии» (Studio access) |
|---|---|---|
| time | 10 s — including bot.http, llm.ask, sleep | the same |
| interpreter steps | 1,000,000 | the same |
| memory | 16 MB of live values | 64 MB |
| call depth | 64 | the same |
| one string | 256 KB | 8 MB |
| one collection | 50,000 elements | the same |
| the block's code | 20,000 bytes (a Cyrillic letter is 2 bytes) | the same |
sleep(d) | up to 5 s at a time | the same |
async fn tasks | 5 unfinished at once | no count |
| a regex pattern built at runtime | 4 KB | the same |
Time, steps, memory, depth, sizes and tasks are interpreter limits: try doesn't catch them. Errors of sleep, bot functions and llm.ask are caught.
sleep(2) # fine
sleep(6) # error: sleep: at most 5 seconds at a time, got 6bot functions
| Function | Per run | Size |
|---|---|---|
bot.say + bot.file | 10 messages | text, caption, link — 4000 bytes; file name — 200 characters |
bot.edit | 10 edits | text — 4000 bytes |
bot.delete | 10 deletes | — |
bot.buttons | 3 calls | 10 buttons per call, label — 64 characters |
bot.set | 50 writes | value — 4000 bytes |
bot.http | 3 requests | 5 s per request; request body — 64 KB, response — 256 KB (8 MB with «Доступ студии») |
bot.store_set + bot.store_delete | 20 writes (no count with «Доступ студии») | value — 4000 bytes (8 MB) |
llm.ask | 5 calls | prompt + system — 16 KB, max_tokens — 1–2000 |
Over the limit — an error naming the function:
include bot
for i in 1..11 { bot.say("Message ${i}") }bot.say: more than 10 messages in one runAn empty bot.say("") doesn't count. A long bot.http response is cut silently — cut JSON no longer parses.
The bot
| What | Limit |
|---|---|
| bot variables | 100 per bot (no count with «Доступ студии»), a name up to 64 characters |
| the bot's script runs at once | 2; a third leaves by «ошибка» at once (too many scripts are running right now) |
| requests per visitor message | 10 across all HTTP request blocks and bot.http |
| blocks per message | 300 — a scenario with an instant loop is stopped |
files included with include | 50, each up to 20,000 characters, 512 KB together |
| custom exits of a block | 10 |
$script_error | 1000 bytes |
Scheduled
| What | Limit |
|---|---|
| scheduled blocks | 5 per bot |
| interval | at most once every 5 minutes; cron of 5 fields, no seconds |
| not allowed | bot.say, bot.file, bot.edit, bot.delete, bot.buttons, bot.wait |
Tasks
Five tasks at once are enough to make three requests in parallel. A sixth unfinished one is an error; for «Доступ студии» bots tasks aren't counted.
include tasks
async fn slow(i) { sleep(1); i }
ts = (1..6).map { slow(it) } # limit: too many tasks: 5 already running
tasks.all(ts)Not at all
The http and io modules, rand, uuid, shuffle, sample, crypto.random, eval. println output shows only in the studio's trial run.
Where to look
The trial run in the editor shows which limit tripped (timeout, steps, memory, depth, size, regex, busy), how many steps and milliseconds were used, and peak memory.