Custom Command Builder
The per-server editor for KAL scripts: code mode works end to end; the current state of visual mode is documented honestly.
The builder is the per-server editor for custom scripts, at Custom commands β Open builder on your server's dashboard. It has two modes and one editor, and they are not equal today β this page tells you exactly what works.
Code mode: use this#
Code mode is a plain textarea with line numbers, Tab-to-indent, and a live Check syntax button that compiles your source without side effects:
- Check syntax runs the real KAL v2 compiler in validate-only mode. Errors arrive with line, column, message and a hint.
- Run simulation dry-runs the script in a sandbox against a mock user and shows the recorded actions β nothing touches your server.
- Save draft stores the script inactive; drafts may contain errors.
- Save & publish compiles and activates; compile errors block the save.
Saves travel to the bot over the websocket with a 25-second window (large scripts compile twice server-side). If the bot is offline the save is refused with bot_unavailable β nothing is stored half-way.
Visual mode: currently broken β use code mode#
The visual mode builds blocks (trigger type, reply text, embed fields, role actions) and generates KAL source for you. The generated source is written in an older, pre-v2 dialect and the v2 compiler rejects it β every visual generation currently fails with:
E001_MALFORMED_VERSION_HEADER: Missing required version header "KAL VERSION 2.0;"
And that is only the first error: the generated trigger spellings, embed object syntax and event.* variables do not exist in KAL v2 (verified against the compiler β with the header added, the source still fails on every construct). The code snippets offered under the editor carry the same problem, despite their "KAL v2 compliant" label.
What this means in practice:
- Start in code mode and paste a verified example.
- If you switch to visual mode, do not trust its output β switch back to code and rewrite, or re-paste your last good source.
- The builder preserves manual code when switching modes where it can parse it, but its parser only understands the old dialect, so treat visual mode as read-only scratch space.
Fixing visual mode to emit real KAL v2 is on the roadmap; this page will be updated when it lands. The honest current answer: write KAL v2 directly.
Version history#
Existing scripts appear in the Custom commands list with their current version. Marketplace-installed scripts show an Update available action when the package moves ahead; per-server scripts can be forked or edited freely (see Custom commands).