A production-ready, all-in-one Discord bot built with TypeScript and discord.js v14, optimized for low-latency performance on Render.
- Advanced Ticket System - Form-based tickets with state management
- Music Player - Spotify metadata + YouTube playback via Lavalink
- AI Support Chat - Pattern-matched automated responses
- Reaction Roles - Classic role assignment via reactions
- Moderation System - Comprehensive mod commands with logging
- Team Management - Team-specific commands and role management
- Security Suite - Anti-spam, anti-raid, anti-nuke, link filtering
- Verification System - Account age and spam checks
- Web Dashboard - Next.js admin panel with Discord OAuth2
- Language: TypeScript
- Discord: discord.js v14, @discordjs/voice
- Music: Lavalink + play-dl + Spotify API
- Database: PostgreSQL (Prisma ORM)
- Cache: Redis (ioredis)
- Queue: BullMQ
- Dashboard: Next.js + TailwindCSS + NextAuth
- Deploy: Render
kodari-all-in-one/
├── apps/
│ ├── bot/ # Discord bot worker
│ └── dashboard/ # Next.js web dashboard
├── packages/
│ ├── database/ # Prisma schema and client
│ └── shared/ # Shared types and utilities
└── docker-compose.yml
- Node.js 18+ or 20+
- PostgreSQL 16+
- Redis 7+
- Discord Bot Token
- Spotify API Credentials
- Clone the repository:
git clone <repo-url>
cd kodari-all-in-one- Install dependencies:
npm install- Copy environment variables:
cp .env.example .env-
Configure
.envwith your credentials -
Start development services:
docker-compose up -d- Generate Prisma client:
npm run db:generate- Push database schema:
npm run db:push- Deploy slash commands:
npm run deploy-commands --workspace=apps/bot- Start the bot and dashboard:
npm run dev- Create a new Web Service
- Build Command:
npm install && npm run build:bot - Start Command:
npm run start:bot - Add environment variables from
.env.example - Enable health check at
/health
- Create a new Web Service
- Build Command:
npm install && npm run build:dashboard - Start Command:
npm run start:dashboard - Add environment variables
- Set
NEXTAUTH_URLto your dashboard URL
- Add PostgreSQL addon in Render
- Add Redis addon in Render
- Update
DATABASE_URLandREDIS_URLin environment variables
- Create separate service for Lavalink
- Use
fredboat/lavalinkDocker image - Mount
lavalink-config/application.yml
All server settings are managed via the dashboard or stored in the database:
- Prefix, welcome messages, logging channels
- Anti-spam/raid thresholds
- Music settings
- Verification thresholds
All commands are slash commands registered globally or per-guild:
/play- Play music/warn,/ban,/kick,/mute- Moderation/team-warn,/team-uprank- Team management/serverstart- Server announcements
Configure up to 5 ticket categories in dashboard:
- One category can use forms (Entbannungsantrag)
- Auto-ping team roles
- State management: Open → Claimed → Closed
- Only session owner can control playback
- Auto-disconnect when voice empty
- 30s grace period after track ends
- Spotify metadata + YouTube streaming
- Dashboard-managed trigger → response pairs
- Regex and keyword matching
- Priority ranking
- Fallback message for unmatched questions
- Redis caching for guild configs (1h TTL)
- Connection pooling for PostgreSQL
- Lazy-loading for rare features
- Rate limiting on high-frequency events
- Sharding support for 2000+ guilds
- Pre-warmed cache on startup
- Health endpoint:
GET /health - Metrics endpoint:
GET /metrics - Sentry error tracking
- Winston logging (console + file)
Run tests:
npm test# Via Render dashboard or API
curl -X POST https://api.render.com/v1/services/{serviceId}/restartredis-cli FLUSHDBnpm run db:migrate --workspace=packages/databaseExport guild config via dashboard or:
npm run backup --workspace=packages/databaseMIT
For issues and feature requests, open an issue on GitHub.