Quick Start
Prerequisites
Section titled “Prerequisites”- Node.js and
pnpminstalled - A Discord application with a bot token and client ID from the Developer Portal
- A test guild ID (optional, but recommended for instant command deploys during development)
-
Scaffold the project
Terminal window pnpm create bightcd my-bight-botpnpm installThe CLI walks you through storage backend selection, command mode, and optional extras. See create-bight reference for all available flags.
-
Configure environment variables
Copy the example env file and fill in your credentials:
Terminal window cp .env.example .env.env DISCORD_TOKEN=your-bot-tokenDISCORD_CLIENT_ID=your-client-idDISCORD_TEST_GUILD_ID=your-test-server-id # optionalSetting
DISCORD_TEST_GUILD_IDlets you push command changes to a single guild instantly, bypassing Discord’s global cache delay (up to an hour). -
Start the bot
Terminal window pnpm start:with-deployThis builds the project, registers commands with Discord, and starts the runtime. Open your test server and run
/ping. The bot should reply correctly.If command metadata changes aren’t appearing in Discord’s slash command picker, redeploy:
Terminal window pnpm deploy:commands:guild # test guild onlypnpm deploy:commands # global (production)See Command Deploy Modes for when to use each.
Key directories
Section titled “Key directories”| Path | Purpose |
|---|---|
src/commands/ | Slash command definitions and handlers |
src/interactions/ | Button, modal, and select menu handlers |
src/services/ | App-owned integrations (database clients, caches, external APIs) |
src/plugins/ | Lifecycle hooks (schedulers, devtools, error reporters) |
src/bight.ts | Framework entry point. Intents, discovery, runtime config |
Project Structure See to understand the directory layout of a Bight app.
Slash Commands See to understand how to start creating your slash commands.