Getting Started
Welcome to ZBR! This guide will help you set up your development environment and create your first Discord bot.
Prerequisites
- Node.js 18 or higher
- A Discord Bot Token (from the Discord Developer Portal)
Installation
Install the ZBR CLI globally using npm:
npm i @zbrlang/zbrCreating a Project
- Initialize a new ZBR project:
zbr init my-awesome-bot - Navigate to your project directory:
cd my-awesome-bot - Open
.envand paste your configuration:DISCORD_TOKEN=your_token_here DATABASE_URL=sqlite://data.db
Running the Bot
Start the bot with the unified runner:
zbr runYou can also use zbr help to see all available commands.
ZBR CLI commands
Use zbr help to list the available CLI commands. Common commands include:
zbr init <folder> Initialize a new ZBR project in the specified folder (defaults to current directory)
zbr run Start the ZBR runtime engine and bring your bot online
zbr update Download and install the latest ZBR runtime engine
zbr version Show the current ZBR version
zbr list List all commands in your commands/ folder
zbr new <type> Scaffold a new command file (prefix, slash, sub-slash, interaction, event)
zbr help Show this help messageThe zbr new <type> command creates a starter command file using the selected type. For example:
zbr new prefix
zbr new slash
zbr new sub-slash
zbr new interaction
zbr new eventThis is a quick way to get a basic .zbr command file scaffolded so you can start building faster.
Command Headers
Every .zbr file must start with a header section that defines how the command is triggered and configured. Header lines always start with #.
Valid Keywords
trigger: The activation keyword or event name.name: Internal identifier for the command.description: A short description (used in slash commands).type: Command mode:prefix,slash,sub-slash,interaction, orevent.scope: Where to register:guild,global, orboth.option: Defines slash command options.
Example Command
#trigger !hello
#name Hello Command
#type prefix
#description A simple greeting command
// This is a comment
Hello, Zusername{}!Your bot is now online! Try typing !hello in your Discord server.