Skip to content

Development

JustEvil edited this page Aug 19, 2026 · 1 revision
  • For contributors and the curious.
  • Assumes you already did the Installation.

πŸ“œ Scripts

Script What it does
pnpm dev Run from source with tsx (includes --debug).
pnpm build Type-check + emit to dist/ (tsconfig.build.json).
pnpm clean Wipe and rebuild dist/.
pnpm start Run the built bot from dist/.
pnpm typecheck tsc --noEmit, no output.
pnpm test Run the node:test suite via tsx.
pnpm lint Biome lint (with --write).
pnpm format Biome check + format (with --write).
pnpm db:generate Generate the Prisma client.
pnpm db:push Push the Prisma schema to the database.
pnpm db db:push then db:generate.

Note

husky + lint-staged run Biome on staged *.ts / *.json files on commit.

πŸ—‚οΈ Project structure

src/
β”œβ”€ commands/      # slash + prefix commands (by category: music, guild, user, developer)
β”œβ”€ events/        # Discord gateway events
β”œβ”€ components/    # component (button/menu/modal) handlers
β”œβ”€ lavalink/      # hoshimi (Lavalink) events β€” node, player, track, queue, lyrics
β”œβ”€ locales/       # translations (en-US, es-419)
β”œβ”€ config/        # default.config.ts / local.config.ts
β”œβ”€ middlewares/   # command middlewares (checks: nodes, voice, player, queue…)
β”œβ”€ generated/     # Prisma client (generated, git-ignored)
β”œβ”€ structures/
β”‚  β”œβ”€ classes/    # Stelle client, database, manager, components, modules
β”‚  β”œβ”€ controllers/# database controllers (playlist, locale, prefix, player, requests)
β”‚  β”œβ”€ types/      # shared types
β”‚  └─ utils/      # functions, data, listeners, decorators, manager helpers
β”œβ”€ module.ts      # module augmentation (seyfert/hoshimi typings)
└─ index.ts       # entrypoint

prisma/schema.prisma   # database schema
assets/                # application.yml, start scripts, fonts, images
tests/                 # node:test test files

Directories are wired in seyfert.config.mjs under locations (commands, events, components, langs, config, lavalink). Stelle uses no manual handlers β€” Seyfert loads everything from those folders.

πŸŽ›οΈ Lavalink events

Stelle wraps hoshimi's events with createLavalinkEvent(...) under src/lavalink/. Node resume is driven by hoshimi's sessionOptions.resumeFn; the rest (track start/end, queue, player, lyrics) are individual event files.

πŸ—ƒοΈ Database

Prisma (client generated to src/generated/prisma) over MongoDB, accessed through controllers on client.database.* (e.g. client.database.playlist). Redis backs the queue store. After editing prisma/schema.prisma, run pnpm db.

βœ… Tests

Tests use the built-in node:test runner through tsx and live in tests/*.test.ts. Run them with pnpm test.

🎨 Formatting

Biome is the linter/formatter (config in biome.json). Run pnpm format before committing (the pre-commit hook also does this on staged files).

🌿 Branches

  • main β€” stable.
  • dev β€” latest features (this wiki tracks it). PRs target dev.

Clone this wiki locally