Discord Bot
Scaffold a Discord bot with discord.js, TypeScript, and explicit development and production entry points.
Why Use This Command?
- Includes a minimal client and login flow so you can add commands and events without rebuilding the project foundation.
- Keeps the bot token in an untracked
.envfile while documenting the required key in the tracked.env.sample. - Uses Nova's type-check and transpile utilities so checking and production output follow the same contract as other workspaces.
- Can compose the background-service Docker profile with
--docker-imagewithout adding an HTTP port or health check.
Requirements
- Node.js runtime — Use any Node.js LTS release.
- Discord application token — Create a bot in the Discord Developer Portal and provide its token as
DISCORD_TOKEN. - Empty directory or monorepo root — Nova auto-detects whether to create a project or add a workspace.
Usage
Options
| Flag | Description |
|---|---|
-d, --dry-run | Run without writing any files. |
--docker-image | Add a production Node image and background-service Compose file. |
--name <name> | Project slug when creating a new monorepo; omit at an existing root. |
--non-interactive | Require every answer as a flag and do not open prompts. |
--workspace-name <name> | Workspace directory name. |
--output <dir> | Output directory. |
Output Files
| File | Description |
|---|---|
.env.sample | Required DISCORD_TOKEN environment variable. |
src/index.ts | Typed Discord client, ready event, and login flow. |
tsconfig.*.json | Nova strict Node.js configs for source, tooling, and tests. |
package.json | discord.js dependencies and Nova-managed workspace scripts. |
Non-Interactive Mode
nova scaffold app discord-bot --non-interactive --name my-bot --workspace-name bot --output ./my-bot
nova scaffold app discord-bot --non-interactive --workspace-name bot --output ./apps/bot
nova scaffold app discord-bot --docker-image --non-interactive --name my-bot --workspace-name bot --output ./my-bot
Registration
Nova registers the workspace with the app role and trackable policy. Its package name follows {projectSlug}-app-{workspaceName}.