A production-grade Discord bot platform — monorepo with per-guild configuration, moderation, tickets, role menus, and integration-ready architecture. Designed for Railway deployment.
- Node.js ≥ 20
- pnpm ≥ 9
- PostgreSQL database (local or Railway-provisioned)
- Discord bot application (Developer Portal)
git clone https://github.com/YOUR_USERNAME/VezbotCodex.git
cd VezbotCodex
pnpm installcp .env.example .env
# Edit .env with your DISCORD_TOKEN, DISCORD_CLIENT_ID, DATABASE_URLpnpm db:migrate:dev # Creates initial migration
pnpm db:generate # Generates Prisma clientpnpm register-commandsGlobal commands take up to 1 hour to propagate. For instant testing, modify
register-commands.tsto use guild-specific registration.
pnpm dev # Development with hot reload
pnpm build # Production build
pnpm start # Production start- Push to GitHub
- Create a new Railway project
- Provision PostgreSQL in the project
- Add a new service → connect your GitHub repo
- Add environment variables:
DISCORD_TOKEN— Bot tokenDISCORD_CLIENT_ID— Application IDDATABASE_URL— Copy from Railway PostgreSQL service
- Deploy —
railway.tomlhandles build + migration + start automatically
The bot runs as a single Railway service. The optional web dashboard can be added as a separate service later.
- Go to Discord Developer Portal
- Create a New Application
- Go to Bot tab → click Reset Token → copy the token to your
.env - Enable these Privileged Gateway Intents:
- Server Members Intent
- Message Content Intent
- Go to OAuth2 → URL Generator:
- Scopes:
bot,applications.commands - Permissions:
Manage Channels,Manage Roles,Moderate Members,Send Messages,View Channels,Embed Links,Read Message History,Manage Messages
- Scopes:
- Copy the generated URL and invite the bot to your server
VezbotCodex/
├── apps/
│ ├── bot/ # Discord bot (main service)
│ │ └── src/
│ │ ├── commands/ # Slash commands by category
│ │ ├── events/ # Discord event handlers
│ │ ├── services/ # Business logic layer
│ │ ├── integrations/ # Integration module registry
│ │ └── lib/ # Client, loaders, registration
│ └── web/ # Dashboard (optional, scaffolded)
├── packages/
│ ├── config/ # Zod-validated environment variables
│ ├── database/ # Prisma schema + singleton client
│ ├── shared/ # Types, constants, feature flags
│ └── discord/ # Embeds, forms, permissions, logger
├── railway.toml # Railway deployment config
├── .env.example # Environment variable template
└── pnpm-workspace.yaml # Workspace configuration
| Command | Category | Description |
|---|---|---|
/ping |
Utility | Bot health check with latency |
/about |
Utility | Bot info, server count, uptime |
/server-config view |
Admin | View all guild settings |
/server-config set-log-channel |
Admin | Set general log channel |
/server-config set-mod-log |
Admin | Set moderation log channel |
/server-config set-mod-role |
Admin | Set moderator role |
/server-config toggle |
Admin | Toggle features on/off |
/setup-tickets |
Admin | Configure ticket system |
/setup-roles |
Admin | Create a self-role menu |
/ticket |
Tickets | Create a support ticket |
/close-ticket |
Tickets | Close current ticket |
/warn |
Moderation | Issue a warning |
/timeout |
Moderation | Timeout a member |
/case history |
Moderation | View case history for a user |
/case view |
Moderation | View a specific case |
/report |
Moderation | Report a user/issue |
| Variable | Required | Description |
|---|---|---|
DISCORD_TOKEN |
✅ | Bot token from Developer Portal |
DISCORD_CLIENT_ID |
✅ | Application ID |
DATABASE_URL |
✅ | PostgreSQL connection string |
NODE_ENV |
❌ | development / production (default: production) |
LOG_LEVEL |
❌ | debug / info / warn / error (default: info) |
DISCORD_CLIENT_SECRET |
Dashboard | For OAuth |
NEXTAUTH_SECRET |
Dashboard | Session encryption |
NEXTAUTH_URL |
Dashboard | Dashboard public URL |
- Slash command framework with dynamic loading
- Per-guild configuration with feature toggles (PostgreSQL)
- Themed embed builder (success/error/warning/info/moderation/ticket variants)
- Reusable modal/form engine with Zod validation
- Ticket system (create, close, permission locking, transcript, logging)
- Role menu system (button-based self-roles with hierarchy safety)
- Moderation commands (warn, timeout, case tracking, DM notifications)
- User report system (modal → mod log channel)
- Member join/leave logging
- Structured logger (pino)
- Railway deployment config
- Graceful shutdown, error boundaries, ephemeral error feedback
- Integration registry (Twitch, YouTube, Twitter, TikTok, Google Calendar — architecture ready, no API calls yet)
- Reminder/event system (database models ready, no active scheduler yet)
- Web dashboard (not included — add as separate Railway service when needed)
MIT