Prerequisites
Discord intents
Enable these in the Developer Portal (they matchsrc/bot.ts):
Slash commands register per guild (
botGuilds), so changes show up immediately rather than after
Discord’s global propagation delay.
Install
-
Clone and install
yarn setupinstalls dependencies, generates the Prisma client intosrc/generated/prisma(gitignored), and pushes the schema to the database. A fresh clone will not typecheck or boot untilyarn prisma:generatehas run. -
Create
.envfrom.env.example: -
Invite the bot with the intents above, then start it:
Environment variables
Keep
.env, src/generated/, and build/ out of git. Never commit tokens or database URLs.
Scripts
Project structure
main.ts and dev.ts) and they are not equivalent — production installs
global error handlers and closes Prisma on shutdown; development does neither.
Related
- Shared database — PostgreSQL contract with TriBridge
- Commands — slash command reference