Caution
Built with AI - This Discord bot and its documentation were produced with assistance from AI coding tool. Treat the codebase as a starting point for people to start working on.
Minimal Discord bot for the Resonite community stack: TypeScript, discordx, Discord.js v14, Prisma (MySQL/MariaDB), and a small Koa HTTP surface.
- Requirements: Node.js 20+, a MySQL-compatible database, and a Discord application with a bot token.
- Environment: Copy
.env.exampleto.envand fill inBOT_TOKEN,BOT_OWNER_ID, andDATABASE_URL. - Database:
npm installrunsprisma generateviapostinstall. Apply schema withnpx prisma migrate deploy(ormigrate devwhile iterating); requiresDATABASE_URLin the environment when you run Prisma CLI commands. - Run locally:
npm install, thennpm run dev(tsx),npm run start:ts-node(same entry as many panels), ornpm run build+npm run start:prodfor compiled JS.
Typical startup uses node for a .js MAIN_FILE or ts-node --esm for TypeScript. This repo supports both.
npm install— installs dependencies;postinstallrunsprisma generate(no separate generate step needed for the client).- Migrations: run
npx prisma migrate deployonce (Install script or SSH), withDATABASE_URLset. - Choose an entry:
- Compiled (recommended): add
npm run buildto your install or startup before launch. SetMAIN_FILEtobuild/main.js, and usenode(notts-node). - TypeScript: set
MAIN_FILEtosrc/main.tsand keep the panel’sts-node --esmbranch.
- Compiled (recommended): add
Bash note: the pattern [[ "${MAIN_FILE}" == "*.js" ]] never matches a filename (it compares to the literal string *.js). Use a glob match instead, for example:
if [[ "$MAIN_FILE" == *.js ]]; then
/usr/local/bin/node "/home/container/${MAIN_FILE}" ${NODE_ARGS}
else
/usr/local/bin/ts-node --esm "/home/container/${MAIN_FILE}" ${NODE_ARGS}
fiEquivalent package.json scripts: start:prod → node build/main.js, start:ts-node → ts-node --esm src/main.ts. A ts-node config block (esm, experimentalSpecifierResolution, transpileOnly) supports ESM + decorators.
On Windows, the start script uses a Unix-style ENV= prefix; use Git Bash/WSL, set ENV yourself, or see docs/agents/ENVIRONMENT.md.
- AGENTS.md — Minimal entry for AI coding agents (build commands, links to detailed guides).
- docs/agents/ — Architecture, extending commands/events/APIs, environment, Disconite/Resonite command reference, Discord setup.
See LICENSE for license details.