Introduction
ZBR is a scripting language for Discord bots. You write commands as plain .zbr files using ZBR functions, no boilerplate, no event handlers, no framework knowledge required.
Choose Your Development Path
ZBR provides two ways to build your bot:
- Webapp Editor (Recommended): A visual, web-based environment. Ideal for rapid prototyping and instant testing with zero local setup. Press the Run button to launch your bot instantly in the cloud.
- CLI (
zbr): A streamlined tool for technical users and production hosting. Manage your entire bot engine, initialize projects, and run code locally or on your own servers.
Core Architecture
ZBR is powered by a high-performance runtime engine built in Rust.
- The CLI (
zbr): Acts as your project manager and binary launcher. - The Engine: A bundled Rust binary that handles the Discord gateway, parses your
.zbrfiles, and executes logic in real-time. - Cloud Runner: The same high-performance engine running in the ZBR cloud, powering the Webapp’s instant execution feature.
- Hot Reloading: The engine watches your
commands/folder. Save a.zbrfile, and the changes are live instantly without restarting.
Commands are plain text files. Each file has a header section (lines starting with #) that defines the trigger, name, and type, followed by the ZBR code that runs when the command is invoked.
Quick Start
Option 1: Webapp Editor (Recommended)
- Head over to the ZBR Webapp.
- Create or import your bot project.
- Build your commands, manage variables, and tweak settings visually.
- Press Run to launch your bot instantly in the cloud for rapid prototyping and interactive testing.
Note: The Webapp “Run” button is strictly for rapid prototyping and interactive testing. For 24/7 permanent production hosting, you must export your project as a ZIP and use the CLI.
Option 2: CLI (For Technical Users)
Get started with ZBR in seconds:
# Install ZBR
npm i -g @zbrlang/zbr
# Initialize a new project
zbr init my-bot
cd my-bot
# Start the bot
zbr runFunction Library
ZBR comes with over 400+ built-in functions covering everything from embeds and moderation to HTTP requests and JSON parsing.
Zero-argument functions can be called with or without brackets, Zusername and Zusername{} are equivalent.