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 install -g @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.
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.