docsGuidesGetting Started

Getting Started

Welcome to ZBR! This guide will help you set up your development environment and create your first Discord bot.

Prerequisites

Installation

Install the ZBR CLI globally using npm:

npm install -g @zbrlang/zbr

Creating a Project

  1. Initialize a new ZBR project:
    zbr init my-awesome-bot
  2. Navigate to your project directory:
    cd my-awesome-bot
  3. Open .env and paste your configuration:
    DISCORD_TOKEN=your_token_here
    DATABASE_URL=sqlite://data.db

Running the Bot

Start the bot with the unified runner:

zbr run

You can also use zbr help to see all available commands.

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, or event.
  • scope: Where to register: guild, global, or both.
  • 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.