Note
Vaneta is under active development. Expect frequent updates while we stabilise the core feature set and infrastructure.
- Modular command, context, and event system for Discord.js v14
- Type-safe configuration powered by
@t3-oss/env-coreand Zod - PostgreSQL database access through Drizzle ORM with automatic migrations at boot
- Bun-first toolchain for fast installs, hot reload, and production builds
- Biome-driven linting/formatting and Husky-managed Git hooks
Follow these steps for a clean setup on a fresh machine.
- Bun 1.1 or newer
- Node.js 20+ (optional but recommended for tooling)
- A running PostgreSQL instance (local Docker container or hosted service)
- Discord bot token with the proper gateway intents enabled
git clone https://github.com/kaanxsrd/discord-ts-bot.git cd discord-ts-bot bun installCopy the example file and fill in your credentials:
cp .env.example .envUpdate .env with the following values:
DISCORD_BOT_TOKEN=your_bot_token DEVELOPER_GUILD_ID=your_dev_guild_id DEVELOPER_USER_ID=your_discord_id DATABASE_URL=postgres://user:password@host:5432/database The bot only supports PostgreSQL. Ensure
DATABASE_URLpoints to a reachable database before starting.
Generate SQL migrations (only needed after schema changes):
bun run db:generatePush the schema to your database:
bun run db:pushMigrations are also executed automatically during application startup, so future schema changes are applied on-the-fly if the migration folder is present.
- Development with hot reload:
bun run dev- Production-style run:
bun run startThe bot initialises the database pool, runs pending migrations, loads commands/contexts/events, and finally logs into Discord using your token.
Prefer containers? A ready-to-go Docker Compose setup is included.
- Ensure Docker Desktop (or an equivalent runtime) is running.
- Copy
.env.exampleto.envand set the values as described above. - Launch the services:
docker compose up --buildDocker starts two services:
db: PostgreSQL 16 with credentials matching the default.envtemplatebot: the Vaneta bot, which waits for the database health check before starting
Data is persisted under ./var/data and the Postgres volume declared at the bottom of docker-compose.yml.
| Command | Description |
|---|---|
bun run dev | Run the bot with hot reload for rapid iteration |
bun run start | Start the bot in production mode |
bun run typecheck | Validate TypeScript types without emitting output |
bun run lint | Run Biome checks |
bun run format | Format the codebase via Biome |
bun run db:generate | Generate Drizzle migrations based on schema changes |
bun run db:push | Apply migrations to the configured Postgres database |
bun run db:studio | Launch Drizzle Studio for interactive DB exploration |
We welcome contributions! To get started:
- Fork the repository and create a topic branch from
main. - Make your changes, ensuring all lint, type, and format checks pass.
- Open a pull request describing the improvements or fixes.
Please include relevant logs, screenshots, or reproduction steps when reporting issues via GitHub Issues.
Distributed under the GPL-3.0 license. See the LICENSE file for more information.