Skip to content

Quick Start

  • Node.js and pnpm installed
  • 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)
  1. Scaffold the project

    Terminal window
    pnpm create bight
    cd my-bight-bot
    pnpm install

    The CLI walks you through storage backend selection, command mode, and optional extras. See create-bight reference for all available flags.

  2. Configure environment variables

    Copy the example env file and fill in your credentials:

    Terminal window
    cp .env.example .env
    .env
    DISCORD_TOKEN=your-bot-token
    DISCORD_CLIENT_ID=your-client-id
    DISCORD_TEST_GUILD_ID=your-test-server-id # optional

    Setting DISCORD_TEST_GUILD_ID lets you push command changes to a single guild instantly, bypassing Discord’s global cache delay (up to an hour).

  3. Start the bot

    Terminal window
    pnpm start:with-deploy

    This 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 only
    pnpm deploy:commands # global (production)

    See Command Deploy Modes for when to use each.

PathPurpose
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.tsFramework entry point. Intents, discovery, runtime config