docsIntroduction

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.

Core Architecture

ZBR is a high-performance execution engine built in Rust, packaged as a convenient npm CLI.

  • The CLI (zbr): Acts as your project manager and binary launcher.
  • The Engine: A bundled Rust binary that handles the Discord gateway, parses your .zbr files, and executes logic in real-time.
  • Hot Reloading: The engine watches your commands/ folder. Save a .zbr file, 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

Get started with ZBR in seconds:

# Install ZBR
npm install -g @zbrlang/zbr
 
# Initialize a new project
zbr init my-bot
cd my-bot
 
# Start the bot
zbr run

Function Library

ZBR comes with over 400+ built-in functions covering everything from embeds and moderation to HTTP requests and JSON parsing.