docsChangelog

Changelog

All notable changes to the ZBR project are documented here.


v1.4.1 - Parser fix and Zupdate interaction

This release addresses a critical parser bug and introduces a new interaction feature for better message management in Discord.

Core

  • Fixed Parser Data Loss — Resolved a bug in parse_arg where arguments containing multiple function calls (e.g., inside Zif) were being truncated.

New Functions

  • Zupdate{} — Signals that an interaction (button/select menu) should update the original message instead of sending a new reply.
  • ZspliceText{text;start;length;replacement} — Modifies a string by removing a specified number of characters and inserting new text.

v1.4.0 - Centralized error handling across all functions

All 390+ ZBR functions now share a single centralized error system in src/error_messages.rs. Every FnOutput::error() call uses the same formatting helpers, producing consistent Line N: Zfunction - message output everywhere.

Core

  • 26 centralized error helperstoo_few_args, expected_snowflake, expected_url, out_of_range, not_found, action_failed_reason, not_available, and more, all producing uniform error messages.
  • Every function updated — All 394+ FnOutput::error calls across the codebase now route through crate::error_messages::*.
  • Helper modules alignedmath/helpers.rs (parse_f64/parse_i64), permissions/helpers.rs, audit/helpers.rs, and json/helpers.rs all use the centralized system.
  • src/error_messages.rs added — single source of truth for error messaging.

v1.3.0 - In-process engine, automod, polls, soundboard, and utility functions

This release eliminates the HTTP runtime server, running the engine in-process for lower latency and simpler deployment. It also adds 5 new function categories and over 30 new functions.

Core

  • Removed HTTP runtime server — The Axum-based HTTP server (/run endpoint) is gone. Code execution now happens directly in-process via the new executor module, eliminating network overhead and the need for axum, tower, and tower-http dependencies.
  • SSRF Protection — HTTP functions now validate URLs against a blocklist of private/reserved IPs and known dangerous hostnames before executing requests.
  • Header ValidationZhttpAddHeader blocks dangerous headers (cookie, host, connection, transfer-encoding, etc.) for security.
  • Auto Content-Type — HTTP requests with JSON-like bodies now auto-detect and set Content-Type: application/json when no content type header is present.
  • ZstartThread now accepts a 6th private argument to create private or public threads.
  • Commented-out ZonlyForIDs guard added to the eval example command.
  • Added url, base64, sha2, md-5 dependencies.

New function categories

Automod ZautomodRule, ZautomodRuleCreate, ZautomodRuleEdit, ZautomodRuleDelete, ZautomodRules Alias: ZautomodRuleUpdateZautomodRuleEdit

Application Emojis ZappEmojis, ZappEmojiCreate, ZappEmojiDelete

Polls ZpollAddAnswer, ZpollAllowMultiselect, ZpollAnswerVoters, ZpollAnswerVotes, ZpollCreate, ZpollEnd, ZpollGet, ZpollSend

Soundboard ZsoundboardCreate, ZsoundboardDefaultSounds, ZsoundboardDelete, ZsoundboardEdit, ZsoundboardPlay, ZsoundboardSound, ZsoundboardSounds

Utility Zbase64Decode, Zbase64Encode, Zduration, Zentitlements, Zmd5, Zsha256, Zskus

New individual functions

ChannelZsyncPerms ForumZforumPostLock, ZforumPostPin MessageZpinList ServerZserverLockdown, ZserverModify, ZeditWelcomeScreen, ZwelcomeScreen StickerZstickerCreate, ZstickerEdit ThreadZthreadArchive, ZthreadList, ZthreadMetadata, ZthreadPin, ZthreadUnarchive VoiceZvoiceRequestToSpeak, ZvoiceStatus, ZvoiceSuppress


v1.2.0 - Bot owner fix, server/thread/voice functions, and CLI improvements

This release fixes bot owner resolution for team/group bots, adds new server/thread/voice functions, improves CLI command support, and expands project initialization.

Core

  • Fixed botOwnerID so it returns the actual bot owner instead of the team ID when the bot is part of a team/group.
  • Added version, list, and new <type> CLI commands.
  • Updated init to support creating a project in a new folder via init <folder>.
  • Removed archived bot voice helper code from archive/bot-voice.

Functions added

Server functions

  • serverChannels, serverRoles

Thread functions

  • threadArchived, threadLocked, threadParentID

Voice functions

  • voiceEmpty, voiceFull, voiceNew, voiceOld

v1.1.0 - Audit & Event Additions

This release adds a new audit-log function category and several gateway-based event triggers.

Audit

  • Added a new audit function category exposing functions:
    • ZauditCount, ZauditEntries, ZauditLatest, ZauditEntryID, ZauditEntryUser, ZauditEntryAction, ZauditEntryTarget, ZauditEntryReason, ZauditEntryChanges
  • Functions fetch and return guild audit log data via the Discord API (JSON output for structured fields).

Events

  • Added new triggers: onBotJoin, onBotLeave, onBoostAdd, onBoostRemove.
  • onBotJoin and onBotLeave map to runtime guild join/leave events and fire only for guilds the bot joins or leaves while online.
  • Boost event detection implemented via guild update comparisons of premium_subscription_count.

v1.0.0 - Production Release

End of Alpha and the first stable production release. This version introduces the official ZBR CLI, automated installation, and multi-OS support.

CLI & Distribution

  • New ZBR CLI — The entire engine is now managed via a unified global command: zbr.
  • Project Initializationzbr init instantly bootstraps a new project with a recommended folder structure, configuration files, and example scripts.
  • Unified Runnerzbr run launches the high-performance Rust execution engine and starts your bot.
  • Multi-OS Support — Official support and pre-built binaries for Linux (x64), macOS (x64 & ARM64), and Windows (x64).
  • Smart Installation — Distributed via npm with a tiny footprint; the CLI automatically downloads the correct binary for your system on install.

Alpha v5

Loop system, async execution, full voice channel coverage, scheduled events, forum channels, stage channels, stickers, invite management, regex, extended string and math utilities, and more.

Core

  • Loop systemZrepeat{N;code} runs a code block N times (max 1000); ZforSplit{code} iterates over the current split text; ZforJson{key;...;code} iterates over a JSON array at a key path. All three are lazy-evaluated. ZloopIndex{} and ZloopValue{} expose the current iteration state inside any loop body.
  • Async executionZasync{name;code} spawns a named background task that runs the code block concurrently; Zawait{name} blocks until that task completes and returns its result.
  • Deferred executionZdelay{duration;code} runs a code block after a delay (e.g. 10s, 2m) in a background task; ZreplyIn{duration;content} replies to the trigger message after a delay. Both are fire-and-forget and cancelled on restart.

Alpha v4

Moderation, message operations, HTTP requests, JSON manipulation, full control flow, error handling, and the component/interaction system.

Core

  • #type interaction — new command type for component interaction handlers.
  • #type event — new command type for Discord gateway event handlers.
  • onInteraction{id?} trigger — runs when a button, select menu, or modal is submitted. Specific handler (onInteraction{my_button}) takes priority over catch-all (onInteraction).
  • ZcustomID{} — returns the custom_id of the current interaction.
  • ZinputValue{fieldID} — reads a submitted modal text input field.

Alpha v2

Reactions, emojis, text splitting, permissions, threads, and blacklists. Introduced the Zif condition system.

Core

  • Zif{condition;then;else?} — lazy conditional evaluation with ==, !=, >, <, >=, <=, contains, startsWith, endsWith, &&, || operators.
  • ZcheckCondition{} — evaluate a condition string and return true/false.

Alpha v1

Initial release. Established the core runtime, parser, and execution model.

Core

  • ZBR scripting language runtime built in Rust.
  • Line-by-line execution with Z-prefixed function call syntax.
  • Argument parsing with ; separator, nested function calls, escape sequences ({, ;, \).
  • #trigger, #name, #type, #description, #scope, #option command header system.
  • Prefix command support (#type prefix).
  • Slash command support (#type slash) with typed options.
  • Hot-reload: commands/ folder is watched and reloaded on file change.
  • SQLite persistence via sqlx for variables and cooldowns.