Skip to content

About

Discord Bot with Web Dashboard - Moderation, Leveling, Giveaways, Tickets, and more

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

110 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– SylaBot โ€” Discord Bot Platform

Node.js Discord.js TypeScript Next.js Prisma

Full-featured Discord bot with modern web dashboard & multi-tenant support

Features โ€ข Quick Start โ€ข Configuration โ€ข Commands โ€ข Multi-Tenant


โœจ Features

๐Ÿค– Bot Modules

Category Features
๐Ÿ›ก๏ธ Moderation Ban, Kick, Timeout, Warn, Purge, Anti-Spam, Anti-Link, Word Filter, Mention Spam
๐Ÿ“ Logging Message logs, Moderation actions, Member events, Voice activity
๐Ÿ‘‹ Welcome Custom messages, Canvas images, Auto-role, Verification system
๐ŸŽฎ Engagement XP/Leveling, Rank cards, Leaderboard, Suggestions, Giveaways
๐ŸŽซ Support Ticket system, Transcripts, Rating system, Multi-panel support
๐ŸŽค Voice Join-to-Create channels, Custom controls, Permission management
๐ŸŽญ Roles Button roles, Reaction roles, Auto-responder, Sticky messages

๐Ÿ–ฅ๏ธ Web Dashboard

  • Modern UI โ€” Glass-morphism design with dark theme
  • Real-time Sync โ€” Redis Pub/Sub for instant updates
  • Multi-language โ€” Vietnamese & English support
  • Secure Auth โ€” Better-Auth with session management

๐Ÿข Multi-Tenant

  • Custom Bots โ€” Users can connect their own bot tokens
  • Database Isolation โ€” Separate PostgreSQL schemas per tenant
  • Encrypted Tokens โ€” AES-256-GCM encryption for security
  • Process Isolation โ€” Each bot runs in isolated process

๐Ÿš€ Quick Start

Prerequisites

Requirement Version
Node.js โ‰ฅ 22.0.0
pnpm โ‰ฅ 10.0.0
PostgreSQL โ‰ฅ 14
Redis โ‰ฅ 7

Installation

# 1. Clone repository
git clone https://github.com/YOUR_USERNAME/discord-bot.git
cd discord-bot

# 2. Install dependencies
pnpm install

# 3. Copy environment file
cp .env.example .env  # Then edit .env with your values

# 4. Setup database
pnpm db:generate
pnpm db:push

# 5. Deploy slash commands
pnpm bot:deploy

# 6. Start development
pnpm dev

โš™๏ธ Configuration

Create .env file in root directory:

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# DATABASE
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
DATABASE_URL="postgresql://user:password@localhost:5432/discord_bot"

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# REDIS
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
REDIS_URL="redis://localhost:6379"

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# DISCORD BOT
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
DISCORD_TOKEN="your_bot_token"
DISCORD_CLIENT_ID="your_client_id"

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# DASHBOARD (Optional)
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
BETTER_AUTH_SECRET="your_32_char_secret"
DASHBOARD_PORT=3000

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# MULTI-TENANT (Optional)
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
TENANT_ENCRYPTION_KEY="your-32-char-minimum-secret"

# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
# CLOUDFLARE R2 (Optional - for image uploads)
# โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
R2_ACCOUNT_ID=""
R2_ACCESS_KEY_ID=""
R2_SECRET_ACCESS_KEY=""
R2_BUCKET_NAME=""
R2_PUBLIC_URL=""

Getting Discord Bot Token

  1. Go to Discord Developer Portal
  2. New Application โ†’ Name it โ†’ Create
  3. Bot tab โ†’ Reset Token โ†’ Copy
  4. Enable Privileged Gateway Intents:
    • โœ… Presence Intent
    • โœ… Server Members Intent
    • โœ… Message Content Intent
  5. OAuth2 โ†’ URL Generator:
    • Scopes: bot, applications.commands
    • Permissions: Administrator
  6. Copy invite URL and add bot to server

๐Ÿ“ Project Structure

.
โ”œโ”€โ”€ apps/
โ”‚   โ”œโ”€โ”€ bot/                    # Discord bot (discord.js)
โ”‚   โ”‚   โ””โ”€โ”€ src/
โ”‚   โ”‚       โ”œโ”€โ”€ commands/       # Slash commands
โ”‚   โ”‚       โ”œโ”€โ”€ events/         # Discord event handlers
โ”‚   โ”‚       โ”œโ”€โ”€ modules/        # Feature modules
โ”‚   โ”‚       โ””โ”€โ”€ services/       # Business logic
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ dashboard/              # Web dashboard (Next.js 15)
โ”‚   โ”‚   โ””โ”€โ”€ src/
โ”‚   โ”‚       โ”œโ”€โ”€ app/            # App router pages
โ”‚   โ”‚       โ”œโ”€โ”€ components/     # React components
โ”‚   โ”‚       โ””โ”€โ”€ hooks/          # Custom hooks
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€ manager/                # Bot process manager (multi-tenant)
โ”‚
โ”œโ”€โ”€ packages/
โ”‚   โ”œโ”€โ”€ config/                 # Shared configuration
โ”‚   โ”œโ”€โ”€ database/               # Prisma schema & client
โ”‚   โ”œโ”€โ”€ security/               # Encryption utilities
โ”‚   โ””โ”€โ”€ types/                  # Shared TypeScript types
โ”‚
โ”œโ”€โ”€ scripts/                    # Utility scripts
โ”œโ”€โ”€ docker-compose.prod.yml     # Production Docker config
โ””โ”€โ”€ turbo.json                  # Turborepo configuration

๐Ÿ“œ Scripts

Command Description
pnpm dev Start all apps (Redis + Bot + Dashboard)
pnpm bot:dev Start bot only (watch mode)
pnpm dashboard:dev Start dashboard only
pnpm build Build all apps for production
pnpm bot:deploy Register slash commands
pnpm db:generate Generate Prisma client
pnpm db:push Push schema to database
pnpm db:studio Open Prisma Studio
pnpm lint Run ESLint
pnpm typecheck Run TypeScript check

๐ŸŽฏ Commands

๐Ÿ›ก๏ธ Moderation
Command Description
/ban <user> [reason] Ban a member
/unban <user_id> Unban a member
/kick <user> [reason] Kick a member
/timeout <user> <duration> Timeout a member
/warn <user> <reason> Warn a member
/purge <amount> Bulk delete messages
๐Ÿ‘‹ Welcome & Automation
Command Description
/setwelcome <channel> Set welcome channel
/setgoodbye <channel> Set goodbye channel
/autorole <role> Set auto-role for new members
/verify setup Setup verification system
/antispam enable/disable Toggle anti-spam
/antilink enable/disable Toggle anti-link
๐ŸŽฎ Engagement
Command Description
/rank [user] View rank card
/leaderboard View XP leaderboard
/suggest <idea> Submit a suggestion
/giveaway start <prize> <duration> Start a giveaway
๐ŸŽซ Tickets
Command Description
/ticket setup <category> Setup ticket system
/ticket close [reason] Close ticket
/ticket add <user> Add user to ticket
/ticket remove <user> Remove user from ticket
๐ŸŽค Temp Voice
Command Description
/tempvoice setup Setup join-to-create
/tempvoice rename <name> Rename your channel
/tempvoice limit <number> Set user limit
/tempvoice lock / unlock Lock/unlock channel
/tempvoice permit / reject Allow/deny users

๐Ÿข Multi-Tenant Mode

Allow users to connect their own Discord bots with isolated databases.

Quick Setup

# Generate encryption key
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"

# Add to .env
TENANT_ENCRYPTION_KEY="your-generated-key"

Pricing Tiers

Tier Max Bots Max Guilds/Bot
๐Ÿ†“ Free 1 1
โญ Pro 1 2
๐Ÿ‘‘ Ultra 1 3

Usage

  1. Login to Dashboard
  2. Navigate to My Bots
  3. Click Create Bot
  4. Enter Bot Token (encrypted automatically)
  5. Click Start Bot

๐Ÿณ Docker Production

# Build and start
docker compose -f docker-compose.prod.yml up -d

# View logs
docker compose -f docker-compose.prod.yml logs -f

๐Ÿ”ง Troubleshooting

Bot doesn't respond to commands
  1. Check bot is online in Discord
  2. Run pnpm bot:deploy to register commands
  3. Wait 1-2 minutes for Discord to update
  4. Check bot has required permissions
Database errors
  1. Verify DATABASE_URL is correct
  2. Run pnpm db:push to sync schema
  3. Check PostgreSQL is running
Redis connection failed
  1. Verify Redis is running
  2. Check REDIS_URL is correct
  3. On Windows, use WSL: wsl redis-server

๐Ÿ“„ License

MIT License โ€” See LICENSE for details.


Made with โค๏ธ by SalyVn

About

Discord Bot with Web Dashboard - Moderation, Leveling, Giveaways, Tickets, and more

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages